|
Posted by ZeldorBlat on 07/07/07 19:22
On Jul 7, 2:59 pm, dwightarmyofchampi...@hotmail.com wrote:
> How do you combine two SELECT statements from two different tables
> into one result (assuming bioth tables have the exact same fields)?
>
> Like, assuming that the query SELECT * FROM Table1 gives the result
>
> ID Name
> 001 Smith
> 002 Jones
>
> and the query SELECT * FROM Table2 gives the result
>
> ID Name
> 247 Simpson
> 856 Beckley
>
> I want a SELECT ... ORDER BY ID statement that will output the
> following data:
>
> ID Name
> 001 Smith
> 002 Jones
> 247 Simpson
> 856 Beckley
>
> How do I do this?
select id, name
from table1
union
select id name
from table2
order by id
Navigation:
[Reply to this message]
|