You can't do

select * from table_1 UNION select * from table_2;

1st the structures of both queries have to be exactly the same. Second, you
have to specify them in the select.

select animalType from table_1 UNION select animalType from table_2;

should work, assuming that you have a field named animalType in both tables
and they are the same type and size.

HTH,
Cal
http://www.calevans.com


-----Original Message-----
From: Mike Mike [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:05 PM
To: [EMAIL PROTECTED]
Subject: Selecting * from 2 tables


Hello list,
How would you go about selecting * from 2 tables?
I have 2 tables: table_1 and table_2

In table_1 I have the following data.
dog
bird
cat
In table_2 I have:
mouse
rat
hampster
How do I show both tables contents like:
+----------+
|dog       |
|bird      |
|cat       |
|mouse     |
|rat       |
|hampster  |
+----------+
I've tried the following but its not producing what I
need.
select * from table_1,table_2;
select * from table_1 where ID IN (select ID from
table_2);
select * from table_1 UNION select * from table_2;
Any help would be great
Thanks for your help
  --Mike


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

---------------------------------------------------------------------
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