python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Partial unique index in Postgres to ensure existence of a row that satisfies the constraint?
I have a users table, a teams table and a users_teams table.
I am looking for a way in postgres to do the following:
I want to ensure that a user always has a default team, a record with is_default tr...
bencex
Votes: 0
Answers: 1
SQL Unique Constraint on Subset of data in table
I have a SQL Server table tbl_Submissions which contains a number of records for any given CaseID. Each Submission has an AuthorisedStatus field which can be "Authorised", "Rejected&quo...
BiigJiim
Votes: 0
Answers: 1
MySQL how to update multiple rows without breaking unique constraint or using placeholder row
In MySQL,
I have a table named Channel (Auto-generated by Prisma ORM)
CREATE TABLE `Channel` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`guildId` INTEGER UNSIGNED NOT NULL,
`name` VA...
Average Capitalist
Votes: 0
Answers: 0
insert row if one with equal value does not already exist
I'm trying to do an insert into table if the table doesn't already contain a field with a specified value. For this I am using this command: INSERT INTO zyprexa (NULL,'hello',0,0,0) SELECT date WHERE ...
guillanBesada
Votes: 0
Answers: 1