Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed up matching of tables using SQL
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00744963
Message ID:
00746154
Views:
23
>actually i've been hearing about that of rushmore technology but i really can't find any good article to read on.
>
>anyway, do you know any way how can i get records from table A that does not exist in table B?
>
>i use this SQL:
>
>SELECT * FROM xm a WHERE NOT EXISTS (SELECT checkno FROM xa b WHERE a.checkno=b.checkno .AND. a.brcode=b.brcode .AND. a.agycode=b.agycode)
>
>any help?

Hi Evelyn. Here's another option. I am not sure which will be quicker in your situation -- depending on the size of the tables, and the indexes set on them, you might see different results -- so I think it's worth testing both out and timing them.

A Left Outer Join with a check for NULL should work as well:

SELECT a.* FROM xm a LEFT OUTER JOIN xa b on a.checkno=b.checkno AND a.brcode=b.brcode AND a.agycode=b.agycode where isnull(b.checkno)

Hope this helps.

Vin
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform