I have a table where i would like to add a unique constraint on pair of columns.
DummyTable
Id name1 type1 name2 type2
1 hello firstname world lastname
I need to add a unique constraint with the combination of the 4 columns like
add constraint name_type_unique
unique ((name1, type1), (name2, type2));
Which means name and type should be unique either way around. It should not be possible to have values like:
Id name1 type1 name2 type2
1 hello firstname world lastname
2 world lastname hello firstname
Is that somehow possible?