MySQL Forums
Forum List  »  InnoDB

Foreign Key referencing multiple tables: possible?
Posted by: Samuel Sol Santos
Date: November 27, 2008 07:20AM

Greetings everyone,

I have now come to a problem that I hope there is a solution to. I have 3 different tables, and all of them have the same column (cod_sap mediumint unsigned not null UNIQUE).

I have to create a fourth table, that will have some of the info of theses other tables, but any cod_sap that appears there MUST be in one of the other tables. Is that possible to enforce using foreign keys?

In summary, is it possible to have a foreign key referencing a column on two different tables using an OR?

Thank you a lot.

Options: ReplyQuote


Subject
Views
Written By
Posted
Foreign Key referencing multiple tables: possible?
4351
November 27, 2008 07:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.