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 2000 Forums
 Transact-SQL (2000)
 retrive unique rows from two table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-05 : 08:08:39
Vishwas writes "hi there
i have 2 table with same structure.
i want retrive data from bith table but remove duplicate entry by using single sql query

table 1
col1
1
2
3
5
7

table 2
col1
2
3
4
6

out must be as follows
1
2
3
4
5
6
7



i have tried out with union and join but not get what i want


vishwas"

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-05 : 08:38:02
select col1 from table1
union
select col1 from table2
order by col1

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

- Advertisement -