jeudi 5 mars 2015

Is it possible to create a foreign key with a condition in MySql?


I have a table 'site' that has a field 'categoryid_root' and a table 'category' which has the fields 'id' and 'parentid' I want to create a relationship between:


'site'.'categoryid_root' and 'category'.'id' but with the condition that 'category'.'parentid' is null is this at all possible in mysql?


Thanks





Aucun commentaire:

Enregistrer un commentaire