Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query

Author  Topic 

yadhu_cse
Constraint Violating Yak Guru

252 Posts

Posted - 2011-03-18 : 02:25:47
Hi,

can any one tel how to comebine result from two table.
example: table1 has two col sy col1 and col2 and in second table col1,col2,col3.
now how to union the result of the two query.


jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-03-18 : 02:48:00
SELECT col1, col2, Null FROM table1 -- replace Null with any value you want
UNION -- or UNION ALL
SELECT col1, col2, col3 FROM table2

Go to Top of Page
   

- Advertisement -