1

How do I specify unique constraint on different combinations of fields? E.g.

 id  | Fld1 | Fld2 | Fld3
-------------------------
  1  |   A  |  B   |  C
-------------------------
  2  |   A  |  C   |  D

I'd like to make the example above illegal because combination (Fld1, Fld3) in row 1 has same values as combination (Fld1, Fld2) in row 2.

Is there any way to do this?

Vasily802
  • 1,703
  • 2
  • 18
  • 35

1 Answers1

0

There is no way possible for this except a trigger but performance will be a constraint. You can only have combine unique key but this case will not fullfil.

Faizan Younus
  • 793
  • 1
  • 8
  • 13