Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help with Select SQL
Message
From
02/05/1998 14:53:17
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096128
Message ID:
00096536
Views:
23
>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
Map
View

Click here to load this message in the networking platform