|
-
Jun 3rd, 2002, 02:49 AM
#1
Thread Starter
Hyperactive Member
query?
table name: sb
studid studname amount
----------------------------------
1 a 1000
2 b 2000
3 c 1000
4 d 3000
table name: bill
studid amt_paid amt_due
----------------------------------
1 300 700
1 300 400
2 500 1500
2 500 1000
bill.studid is a foreign key of sb.studid
the amount paid is deducted from amount .
I need an output of this format
studid studname amount amt_paid amt_due
----------------------------------------------------------------------
1 a 1000 600 400
2 b 2000 1000 1000
3 c 1000 0 1000
4 d 3000 0 3000
help me in constructing the query?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|