Hi Mike,
SELECT * FROM Table_A WHERE NOT EXISTS ( SELECT Table_B.PK FROM Table_B WHERE Table_B.PK=Table_A.PK)
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.