Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL on Two Tables where All Fields Match
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00526958
Message ID:
00527281
Vues:
45
>>Is there a way to write SQL to find all the records in TableB that match every field in TableA? There are 200+ fields in both tables (same structures) with about less than 100 records in TableA and 200,000 in TableB. I'm trying to do a nested select using the distinct clause, but I can't seem to get either the syntax or the result right. Psuedo code something like:
>>
>>select * from TableA where AllFields not in (select AllFields from TableB)into cursor Result
>>
>>...or can I compare arrays somehow?
>>
>>Thanks!
>>
>>Regards, Renoir
>
>Since you have only ~100 records in tableA, I would use Nick's idea and scan TableA. If you would have 200000 rec. in both tables, the scan would be slower than SQL.

But I think it still will be faster than designing and testing the "fast" SQL :)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform