Combine two or more query using UNION

by Vinoth 2009-02-04 20:14:44

If we want to display a content of two or more tables which are ideal to each other. Then there is no need to use separate queries
like


select id,name from table1;
select id,name from table2;
select id,name from table3;

It can be done by a single query


select id,name from table1 UNION select id,name from table2 UNION select id,name from table3;

Tagged in:

679
like
0
dislike
0
mail
flag

You must LOGIN to add comments