I have columns that look like this:
value1____value2
value3____value4
value2____value1
value5____value6
Is there any way to eliminate the combination on the 3rd line, since it's essentially the same as { value1, value2 }?
I have columns that look like this:
value1____value2
value3____value4
value2____value1
value5____value6
Is there any way to eliminate the combination on the 3rd line, since it's essentially the same as { value1, value2 }?
What about this approach?
ALTER TABLE the_table ADD CONSTRAINT my_check
UNIQUE (LEAST(column1, column2), GREATEST(column1, column2))