Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help with Select SQL
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096128
Message ID:
00096447
Views:
19
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform