Click here to Skip to main content
15,912,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Select Name from Table1
Result:
Name
AAAA
BBBB

Select Name from Table2
Result:
Name
CCCC
DDDD

i need a result like

Name
AAAA
BBBB
CCCC
DDDD

What is the query for this?
Posted

SELECT *FROM Table1
UNION ALL
SELECT *FROM Table2
 
Share this answer
 
SQL
SELECT [Name]
FROM Table1
UNION ALL
SELECT [Name]
FROM Table2


Morea bout: UNION (T-SQL)[^]
 
Share this answer
 
v2
Comments
Abhinav S 6-Jun-13 4:52am    
Of course .5.
Maciej Los 6-Jun-13 5:36am    
Thank you, Abhinav ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900