How to make sure that a couple of rows (A,B) values can be duplicated but can have only one corresponding value in row C in the same table ?
Suppose i am inserting these rows in this order this the output i want to have.
EDIT: what i want is that when A,B,C is inserted for the first time value in C will be the unique possible value for the couple (A,B)
this means, if i, insert (0,0) with C = 1 when there is no other (0,0) couples in (A,B) then the row is accepted.But if i add (0,0) for the second(third ..) time; then C has to be equal to 1.
example :
A | B | C | D | F ...
_________________
0 | 0 |1
0 | 0 |1
0 | 0 |2 --> not allowed
1 | 0 |3 --> allowed
1 | 0 |2 --> not allowed
1 | 0 |3 --> allowed