Select result from 2 tables and join them in 1 query

Post Reply
mister_v
Posts: 188
Joined: Thu Mar 04, 2010 9:19 pm

Select result from 2 tables and join them in 1 query

Post by mister_v »

Hello,

I would like to get the result from 1 table and the result from another table,
put them in 1 query and have the result in 1 column.

So inner join is not what I want to use.


table1: table2:
Name Name
a1 A2
b1 B2
c1 C2

The result should be something like this:
Name
a1
b1
c1
A2
B2
C2


Is it possible?
chris
Site Admin
Posts: 194
Joined: Mon Jul 21, 2008 9:52 am

Re: Select result from 2 tables and join them in 1 query

Post by chris »

You can use union

Code: Select all

SELECT name FROM table1 UNION SELECT name FROM table2;
that should work :-)
Post Reply