Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exclude some records from a table
Message
 
To
24/02/2005 11:13:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00990141
Message ID:
00990145
Views:
17
>Hello, i have two tables and there are some matching records from one table to the other, i need to build a sql statement where displays only the records that does not match. How can i do this?
>
>Thanks for the support.
SELECT * FROM Table1;
       LEFT JOIN Table2 ON Table1.Key == Table2.Key;
       WHERE ISNULL(Table2.Key);
INTO CURSOR cBrowse

*** Other way

SELECT * FROM Table1;
       WHERE .NOT. Table1.Key IN (SELECT DIST Table2.Key FROM Table2);
INTO CURSOR cBrowse
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform