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 |
|
neil_akoga
Yak Posting Veteran
56 Posts |
Posted - 2010-06-10 : 04:08:51
|
| I have 2 tables, atblBig and atblDistinctI want to delete all the row in atblBig that DO NOT appear in atblDistinct. I can select them as follows but how would i re-work this to delete these rows. SELECT atblBig.BigIDFROM [atblBig] AS atblBigLEFT JOIN [atblDistinct] AS atblDistinct ON atblDistinct.BigID = atblBigt.BigIDWHERE atblDistinct.BigID IS NULL |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-06-10 : 04:15:14
|
delete atblBig where not exists(select * from atblDistinct where atblDistinct.BigID = atblBigt.BigID) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
neil_akoga
Yak Posting Veteran
56 Posts |
Posted - 2010-06-10 : 04:37:01
|
| cheers fred. much appreciated |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-06-10 : 04:43:46
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|