Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement