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
 SQL Server Development (2000)
 Inverting a set?

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2002-06-26 : 06:25:18
I get updates to a table of user data in text format from our customer. It's pretty easy to isolate the updates using
update users set a=b
from users inner join updates
on users.ID=UPDATES.ID

This gives me the modifications to existing user records, now what is an elegant way to invert the inner join to find additions - new users in the customer update that do not exist in the DB?

Sam

nr
SQLTeam MVY

12543 Posts

Posted - 2002-06-26 : 07:14:15

select updates.*
from updates
left outer join users
on users.ID=UPDATES.ID
where users.ID is null

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -