| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: Select query for sum of hours
select sum ( sum_hours ), note_group from ( select decode ( note,
'ACT', 'ACT-CHG',
'CHG', 'ACT-CHG',
null ) note_group, decode ( note,
'EXT', 'EXT-INT',
'INT', 'EXT-INT',
null ) note_group, sum_hours from ( SELECT note,SUM(hours) sum_hours FROM WW_REC_1 where trans_date between last_DAY(ADD_MONTHS(SYSDATE, -2))+1 and LAST_DAY(ADD_MONTHS(SYSDATE,-1)) GROUP BY NOTE ) ) group by note_group;
Pratap
Cognizant Technology Solutions, India
Received on Wed Aug 11 2004 - 00:43:24 CDT
![]() |
![]() |