Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find records not in another table
Message
De
01/06/2010 10:56:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01466852
Message ID:
01466865
Vues:
40
>All I want to do is hav an SQL statement that gets a list of items from the main item table,but not list items already selected in the other table.
>
>Any ideas?
>Mike

You can either use a subquery:
select * from Table1;
  where KeyField not in (select KeyField from Table2)
Or do an outer JOIN, in which case the non-matching records have null values:
select Table1.KeyField, Table2.FieldX, Table2.FieldY;
  from Table1 left join Table2 on Table1.KeyField = Table2.KeyField;
  where isnull(Table2.KeyField)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform