Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compound key exclusion select
Message
 
 
To
21/07/2005 12:08:07
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01034714
Message ID:
01034719
Views:
19
This message has been marked as the solution to the initial question of the thread.
SELECT t1.* FROM Table1 t1
  WHERE NOT EXISTS ( SELECT * FROM table2.t2 WHERE t2.id1 = t1.id2 AND t2.id2 = t1.id2)
>What would be the proper syntax for a select statement which excludes rows based on a compound key? For example:
>
>SELECT * FROM Table1
>Where ID1 and ID2 not in Table2
>
>This is obviously the wrong syntax, but I would like all of the items is Table1 where the key of ID1 and ID2 do not exist in Table2.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform