SQL Language (MOSC)

MOSC Banner

cartesian product

edited Aug 22, 2010 9:24PM in SQL Language (MOSC) 1 commentAnswered
 Dear all,
I have 2 tables with columns:
 student_no (foreign key), date and amount in both tables.

now I want to select the sum of the amounts for a student for specific date.

the following query is from stu_fee_payment table.

select sum(sfp.amount)
from stu_fee_payment sfp
where student_no =1
and sfp.pay_date < TO_DATE('01-AUG-2010','DD-MON-YYYY')

result: 200

the following query is from stu_fee_adjustment table.

select sum(sfa.adj_amount)
from stu_fee_adjustment sfa
where student_no =1
and sfa.adj_date < TO_DATE('01-AUG-2010','DD-MON-YYYY')

result: 400

now I have the following query

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