Multiple Foriegn Keys from One Table linking to single Primary Key in second Table
- by croker10
Hi all,
I have a database with three tables, a household table, an adults table and a users table. The Household table contains two foreign keys, iAdult1ID and iAdult2ID. The Users table has a iUserID primary key and the Adult table has a corresponding iUserID foreign key. One of the columns in the Users table is strUsername, an e-mail address.
I am trying to write a query that will allow me to search for an e-mail address for either adult that has a relation to the household. So I have two questions, assuming that all the values are not null, how can I do this?
And two, in reality, iAdult2ID can be null, is it still possible to write a query to do this?
Thanks for your help. Let me know if you need any more information.