Depending on which version of mysql you are using you could use
Union
http://www.mysql.com/doc/U/N/UNION.html

or you could use a Merge table
http://www.mysql.com/doc/M/E/MERGE.html

another option would be to place the results of both queries into a
temporary table
and query that.



-----Original Message-----
From: Christian [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:22 AM
To: [EMAIL PROTECTED]
Subject: joining 2 identical tables



hi,

i'm working on a project for managing used motorcycles. for security reasons
i setup two identical tables. both with the same attributes.
ID,UNIID,Manufacurer... one of the tables is named "Com" and the other
"Prv".

till now i used to search either "Com" or "Prv". but i want to look for a
match in both of them and listing the result. i have tried anything i knew,
but without luck.

please can anyone tell me, how the SQL Statment must look like to get such
an output?

-------------------------------------
Com
-------------------------------------
ID | UNIID | Manufacturer |
-------------------------------------
1  | 12D2  | Yamaha       |
2  | 21E3  | test              |

-------------------------------------
Prv
-------------------------------------
ID | UNIID | Manufacturer |
-------------------------------------
1  | 43I2   | Kawasaki      |
2  | 68U2  | Something    |


-------------------------------------
output ????
-------------------------------------
ID | UNIID | Manufacturer |
-------------------------------------
1  | 43I2   | Kawasaki      |
2  | 68U2  | Something    |
1  | 12D2  | Yamaha       |
2  | 21E3  | test              |


(Data of ID's equals, UNIID's are different, Manufacturer's are different.)

many thanx in advance

yours christian



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to