Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with Select SQL
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00096128
Message ID:
00096447
Vues:
20
I concede that the inner join and union is the most elegant, but I have found Visual FoxPro to be just too slow for large (or even just networked) record sets. What's worse, sometimes my users don't have the system resources I have, so the query won't even complete for them. So, I often try splitting the union into cursors, and then joining the cursors. The result is the same, but it may be much faster. Try this:

SELECT DISTINCT Clients.Client_num,Clients.Client_SRC,Clients.FName,Clients.LName ;
FROM Clients, Bal ;
WHERE Clients.Client_SRC+STR(Clients.Client_Num)=Bal.Client_SRC+STR(Bal.Clients_Num) ;
INTO CURSOR Bal_Clients

SELECT DISTINCT Clients.Client_num,Clients.Client_SRC,Clients.FName,Clients.LName ;
FROM Clients, Ver ;
WHERE Clients.Client_SRC+STR(Clients.Client_Num)=Ver.Client_SRC+STR(Ver.Clients_Num) ;
INTO CURSOR Ver_Clients

SELECT * FROM Bal_Clients ;
UNION ;
SELECT * FROM Ver_Clients ;
INTO CURSOR Bill_Clients

The UNION will filter duplicate entries from each cursor.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform