Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compound key exclusion select
Message
 
 
À
21/07/2005 12:08:07
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01034714
Message ID:
01034719
Vues:
18
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform