General information
Category:
Coding, syntax & commands
>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.
I'm wondering if I need to get so complicated for this. All I need is a list of clients and their paysources that appear in either the ver table or the bal table. Since both tables have both client number and paysource in them, do I even really need to use the clients table at all?
Thanks,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only