Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Again
Message
From
04/05/2000 23:39:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL Again
Miscellaneous
Thread ID:
00366421
Message ID:
00366421
Views:
44
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...
Next
Reply
Map
View

Click here to load this message in the networking platform