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 |
|
WJHamel
Aged Yak Warrior
651 Posts |
Posted - 2012-01-24 : 14:12:05
|
| So i'm using the following query to identify entries, based on unique value, which are in one table but not another:select * FROM civil.dbo.ref2table t1WHERE receiptid NOT IN (SELECT receiptid FROM civil.dbo.reftable t2 WHERE t2.receiptid=t1.receiptid)My intent was to then delete those results from that table, leaving behind the entries i want. It seemed like i would either use:DELETE * FROM civil.dbo.ref2table t1WHERE receiptid NOT IN (SELECT receiptid FROM civil.dbo.reftable t2 WHERE t2.receiptid=t1.receiptid)orDELETE FROM civil.dbo.ref2table t1WHERE receiptid NOT IN (SELECT receiptid FROM civil.dbo.reftable t2 WHERE t2.receiptid=t1.receiptid)Neither works. Syntax.Where am i going wrong? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|