Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find child records not in parent table
Message
De
09/03/2011 10:21:44
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01503028
Message ID:
01503029
Vues:
44
select * from ChildTable where not exists (select 1 from ParentTable where ChildTable.fielda != ParentTable.fielda)

>I must be missing something very simple. I am trying to find records in the child table that have no corresponding records in the parent table. Here is what I do:
>
>
>select * from ChildTable join ParentTable where ChildTable.fielda != ParentTable.fielda
>
>
>But it does not work. TIA.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform