0

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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.