Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Again
Message
De
04/05/2000 23:39:01
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL Again
Divers
Thread ID:
00366421
Message ID:
00366421
Vues:
43
Hi,
I need to do the query as the following:
Table User
UserID              UserName
0001                John
0002                Jones
0003                PDRM

TableSales
UserID              SalesAmt       InvoiseNo
0001                1000           00001
0001                2000           00002
0002                 500           00003

TableTopup
UserID              TopupAmt       TranNo
0001                1000           000001
0002                1100           000002

Expected Result
UserID: 0001
UserName: John
     SalesAmt        3000       (SUM)
     TopupAmt        1000       (SUM)

UserID: 0002
UserName: Jones
     SalesAmt         500       (SUM)
     TopupAmt        1100       (SUM)
Seem there are not any transaction involve User 0003, therefore, it should not be displayed.

Any ideas with how the SQL statement should be look like?

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform