Query to grab the sum and the most recent values?
604073Oct 23 2007 — edited Oct 23 2007hi,
Just wondering if its possible to have a query on the temp table,
which fetches school,most_recent(sub1),sum(sub2),sum(sub3) group by school
table temp
SCHOOL DATE1 SUB1 SUB2 SUB3
--------------------------------- --------- ---------- ---------- ----------
ABC 01-AUG-07 1 5 6
ABC 02-AUG-07 2 5 6
ABC 03-AUG-07 3 5 6
ABC 04-AUG-07 4 5 6
ABC 05-AUG-07 5 5 6
XYZ 01-AUG-07 6 7 8
XYZ 02-AUG-07 7 7 8
XYZ 03-AUG-07 8 7 8
XYZ 04-AUG-07 9 7 8
XYZ 05-AUG-07 10 7 8
Just wondering if its possible to have a query on the temp table,
which fetches school,most_recent(sub1),sum(sub2),sum(sub3)
required output
SCHOOL SUB1 SUB2 SUB3
------------- --------- ---------- ----------
ABC 5 25 30
XYZ 10 35 40
thanks