Validation: combination of 2 fields can occur only once in the database

Validation: combination of 2 fields can occur only once in the database

d-podd-pod Posts: 8Questions: 3Answers: 0

Hi,

I have to make sure that a combination of 2 fields can occur only once in the database before create. Is there a solution for this? I know that for single fields it can be solved with unique. Is there also something for combinations?

For example, a combination of a car and a car key may only occur once. This means that it would have to be checked beforehand whether such a combination already exists in the database, should someone try to create such a combination again. (Red car + Key no. 1 must be unique)

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.