cartesian product
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
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
0