Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement Help
Message
De
14/03/2001 12:59:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00484934
Message ID:
00484965
Vues:
16
>>What is the syntax for a select statement where I want to select all the records in table1 that don't exist in table2
>>
>>Thanks
>
>You can use a simple subquery.
>select t1.* from table1 t1 where t1.key not in (select t2.key from table2 t2)
>If your definition of existing is based on multiple fields, you can concatenate them in your subquery.
>select * from table1 t1 where t1.field1+t1.field2+t1.field3 not in ;
>   (select t2.field1+t2.field2+t2.field3 from table2 t2)
>If the fields are not the same datatype, you can use transform() to convert them to character.
>
>HTH.

SWEET, Thanks a bunch, I'll give it a whirl :)
Thanks
Jon
Non-MVP Non-MCP Non-MCSE

Visual FoxPro, What else is there?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform