Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with Select SQL
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00096128
Message ID:
00096915
Vues:
21
>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?

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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform