Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding Orphans
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00508438
Message ID:
00508446
Vues:
18
>I'm trying to figure out the SQL Syntax to find orphan records in a detail table, that have no counterpart in a parent table. This is something like SELECT all records in TABLE A which don't have a matching record (on a key field) in TABLE B. I can do this with brute force in good 'ol dbase code, but can't SQL do this?
>
>Thanks.
>
>--- L

Heres a try:

SELECT * ;
FROM tblMaster;
WHERE tblMASTER.keyfield NOT IN (SELECT keyfield FROM tblDetail)
-- Larry Keyes
Remember only You can prevent Gray Goo. Never release nanobot assembers without replication limiting code.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform