![]() |
|
|
#1 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
Foreign Key too Two Tables
The Design:
I have three tables. One is called Residential. The Second is Business. The third is Requests. Residential and Business Both contain a primary key that is called cust_id. The Problem: When create the requests table I issue the following command Code:
Is it posible for my foreign key to refer back to two tables or am I going to have to combine the two tables into one? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
Re: Foreign Key too Two Tables
I can't really help you because I know nothing of foreign keys, but looking at the documentation for it, I see no reference to the word "AND" in the syntax.
http://dev.mysql.com/doc/refman/5.0/...nstraints.html Looking in the notes, one person had tried something where it looked like references 'tablename1','t2'(columns) or something like that. He also got an error but he said it was due to referencing an ISAM table. This probably won't help but I gave it a shot.
__________________
** Most misspellings intentional to combat spaham filterz** |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
Re: Foreign Key too Two Tables
Thanks. That was the first place I looked at. Right now I have the two tables broken down into one table but I would like to use it the other way if at all possible.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Populating MySQL Memory Tables | martman | General | 1 | 11-24-2004 08:26 AM |
| 1.2.4 How Big MySQL Tables Can Be | Administrator | Documentation | 3 | 10-21-2004 12:38 AM |
| 3.6 Examples of Common Queries | Administrator | Documentation | 9 | 06-29-2004 09:07 AM |
| 3.4 Getting Information About Databases and Tables | Administrator | Documentation | 0 | 06-25-2004 01:27 PM |
| 1.8 MySQL Standards Compliance | Administrator | Documentation | 21 | 06-08-2004 03:18 AM |