MySQL select command
I have 2 tables A and B, both get a field of name.
I would like to know how to show all the name from both a and b.
e.g.
A has names : John, Ken, May
B has names : Paul, Nau, Raul
I want to have the result like
Name
---
John
Ken
May
Paul
Nau
Raul
I don't want to make it as two separate field (e.g. select a.name, b.name from a, b)
Please advice.
Thank you
[451 byte] By [
dummyagain] at [2007-11-20 3:28:12]

# 1 Re: MySQL select command
Does MySQL supports "Union" ? I am not sure.
If it is try
select name from a union select name from b;
Ashish
# 3 Re: MySQL select command
Thank you for your information.
However, I wonder if there are more tables.. there will be very long script like the following one.
select email from user where email='a@gmail.com' union select email
from userb where email='a@gmail.com' union select email from userc where
email='a@gmail.com';
I would like to know if there are simpler method to do the above query?
Thankyou