Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql command to exclude records
Message
De
19/07/2000 07:15:07
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00394238
Message ID:
00394242
Vues:
12
>I need to run a SQL statement which selects all records from File1 ,but excludes any records where there is a link to a second file based on one of the fields:
>
>In simple terms:
>
>e.g. File 1: F1_code,F1_Name
> File 2: F2_Code
>
>
>Select * from File1 where (F1_code does not already exist in File2)
>
>Is there a way of doing this in SQL. I tried using a where Seek(..) = .F. but know from past experience that its a bit dicey using functions inside a SQL statement
>
>Regards,
>
>Gerard

HI,

SELECT * FROM File1 WHERE F1_code NOT IN (SELECT DISTINCT F2_Code FROM File2)
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform