当前位置: 动力学知识库 > 问答 > 编程问答 >

mysql - can a table have two foreign keys of the same table?

问题描述:

I have one table named Registration and another table named Login. I want to fetch ID and Type columns of Registration table into Login table. Can I do it with Foreign key?

网友答案:

Yes you can, if this composite foreign key corresponds to a composite primary key in the referenced table. You can also do that if the referenced table has a unique index on the two columns.

分享给朋友:
您可能感兴趣的文章:
随机阅读: