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.
Author |
Topic |
Rliss
Starting Member
31 Posts |
Posted - 2006-10-19 : 12:32:44
|
Let's say that I have to tables that have the same layout.Tab1linkset_name------------LS1LS2LS3andTab2linkset_name------------LS5LS4LS1What I need to do is select all the linkset_name from Tab2 that do NOT exist in Tab1. In this example the results that I am looking for:linkset_name------------LS5LS4Thanks in advance...RLiss |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-10-19 : 12:43:35
|
select *from Tab2 where linkset_name not in (select linkset_name from Tab1)select t2.*from Tab2 t2left join Tab1 t1on t1.linkset_name = t2.linkset_namewhere t1.linkset_name is null==========================================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. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2006-10-23 : 09:44:29
|
Beware NULL ...Jay White |
|
|
|
|
|