-- Collect the matches
SELECT l.ID ;
FROM LARGE l ;
INNER JOIN small s ;
ON s.ID <> l.ID ;
AND LARGE.Z5 = small.z5 and Large.ln = small.ln and Large.fn = small.fn ;
INTO TABLE SuppressedRows.DBF ;
-- Then use the ID's to restrict table LARGE
SELECT l.ID ;
FROM LARGE l ;
WHERE l.ID NOT IN (SELECT ID FROM SuppressedRows) ;
INTO TABLE SuppressedRows.DBF ;
-- You might be able to do this in one step (it's a while since I've used Foxpro SQL)
SELECT l.ID ;
FROM LARGE l ;
WHERE l.ID NOT IN ( ;
SELECT l.ID ;
FROM LARGE l ;
INNER JOIN small s ;
ON s.ID <> l.ID ;
AND LARGE.Z5 = small.z5 and Large.ln = small.ln and Large.fn = small.fn) ;
INTO TABLE SuppressedRows.DBF ;
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden