Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed up matching of tables using SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00744963
Message ID:
00746154
Vues:
24
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform