Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL EXISTS clause
Message
 
À
16/10/2002 12:04:34
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00711792
Message ID:
00711801
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
Hi Mike,
* Table_A.PK =Table_B.PK
SELECT * FROM Table_A WHERE NOT EXISTS ( SELECT Table_B.PK FROM Table_B WHERE Table_B.PK=Table_A.PK)

* OR 
SELECT * FROM Table_A WHERE NOT Table_A.PK IN ( SELECT Table_B.PK FROM Table_B WHERE Table_B.PK=Table_A.PK)
MartinJ

>Hi All,
>
>I need help creating a VFP SQL select statement that conditionally selects records from two tables as follows:
>
>1) Both tables have the same fields (names, types, size, etc. are identical)
>2) Table 'A' contains all records, say 100.
>3) Table 'B' contains a subset of Table A's records, say 20.
>4) I would like to execute a query that selects the 80 records in Table A that do not exist in Table B.
>
>When I checked the VFP6 help for Select SQL, there was an example that used an EXISTS clause. I could not find any further help regarding this option. How does it work? How can I apply it to my problem?
>
>Thanks in advance to all who try to assist.
>
>Mike.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform