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
 General SQL Server Forums
 New to SQL Server Programming
 Retriving Values from Two Tables

Author  Topic 

samhrishi
Starting Member

13 Posts

Posted - 2011-01-25 : 05:22:51
How can i Retrive distinct Two Coloumn values from multiple tables.


sam

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-01-25 : 05:41:25
select distinct col1, col2 from tbl1
union
select distinct col1, col2 from tbl2
union
select distinct col1, col2 from tbl3


the union will do a distinct on the final resultset.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -