SQL Language (MOSC)

MOSC Banner

how to sum for the spicific row in the date range?

edited May 25, 2010 1:51AM in SQL Language (MOSC) 15 commentsAnswered ✓
 Dear all,
I have 2 tables, one stu_fee and 2nd stu_fee_payment

with the following structures:

SQL> desc stu_fee
Name       Type   
---------- ------- -------- ------- --------
STUDENT_NO NUMBER                           
FEE_MONTH  CHAR(8)                          
ADMISSION  NUMBER      
TUTION     NUMBER          
EXAM       NUMBER         
TRANSPORT  NUMBER  
FINES      NUMBER

SQL> desc stu_fee_payment
Name       Type        
---------- ------------- -------- -------
RECEIPT_NO NUMBER       
PAY_DATE   DATE        
STUDENT_NO NUMBER(5)         
AMOUNT     NUMBER(4)   
REMARKS    VARCHAR2(200)

I want to build a report of summary of the fees of a student:

like this one:

student No.        Fee Month            Fees               Payments
1                       Apr-2010             230                  0
1                       May-2010            1800                900



but by the following


SELECT SF.STUDENT_NO, SF.FEE_MONTH, SF.TUTION+SF.ADMISSION+SF.EXAM+SF.TRANSPORT+SF.FINES TOTAL,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center