Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I would know if can be declared in MySQl to create an index constraints in a table with two foreign key that one can be null. For example cannot be repeated a null foreign key with the other foreign key setted:

first foreign key: 1 second foreign key: 1

first foreign key: 1 second foreign key: null

so this two foreign keys can be saved correctly in the table but if I try to save again

first foreign key: 1 second foreign key: null

I should receive an error from the database. I'm not able to express this control in SQLYog.

Someone have experience on this type of problem?

Thanks in advance.

share|improve this question
1  
Show us all the tables invlolved (SQL code preferred) and explain why you need this. –  ypercube May 30 '13 at 7:30
    
...also, what version of MySQL? –  Michael - sqlbot May 31 '13 at 2:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.