Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help with Select SQL
Message
From
05/05/1998 10:23:32
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096128
Message ID:
00097012
Views:
24
>Ah-ha! Right you are. You only need to select from the two tables that have billable clients in them, since you don't care about clients (in the Clients table) that are not billable. So, all you need is a single join:
>
>SELECT DISTINCT Client_num, Client_SRC, FName, LName ;
>FROM Ver ;
>UNION ;
>SELECT DISTINCT Client_num, Client_SRC, FName, LName ;
>FROM Bal ;
>INTO CURSOR Billable_Clients
>
>Again, the UNION will filter any rows that appear in both tables. This should be acceptably fast, too. Oh, I like it. Let us all know if this doesn't give you the right results.

What happens if Jimmy Jones is in both ver and bal? I want him to show up in the final table, but only once.

Will that do it?

I must admit this is more elegant than what I came up with. Once I realized that the select I had actually wasn't doing what I wanted to, and having a serious time constraint, along with a limited knowledge of SQL, I resorted to a rather clunky method. I copied all clients from the ver table into another table. Then I appended to that table all clients in bal that weren't already in the new table. It works, but it's not pretty. :)

BTW - I love your flag!

Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform