select A.Work_item_code,A.work_description,sum(mat_amount) from mwebwork A, MWEBWORK B, mwebmatrix where B.WORK_ENTITY_TYPE=4 and mat_work_id=B.work_id and mat_category between 2500 and 3999 and
mat_date between to_date('01-Dec-2000', 'DD-MON-YYYY') AND TO_DATE('10-DEC-2000', 'DD-MON-YYYY') AND A.WORK_ID=B.WORK_PAR6 AND A.WORK_LEVEL=6 GROUP BY A.WORK_ID, A.WORK_ITEM_CODE, A.WORK_DESCRIPTION
Is there any way I can get the Summation of Sum(mat_amount) at the bottom of this select statement ?
If you want a total of the sum(mat_amount) field you can compute the total using the following:
column total format 9999990
compute sum of total on report
select A.Work_item_code,A.work_description,sum(mat_amount) "total"
from mwebwork A, MWEBWORK B, mwebmatrix
where B.WORK_ENTITY_TYPE=4 and mat_work_id=B.work_id and mat_category between 2500 and 3999 and
mat_date between to_date('01-Dec-2000', 'DD-MON-YYYY') AND TO_DATE('10-DEC-2000', 'DD-MON-YYYY') AND A.WORK_ID=B.WORK_PAR6 AND A.WORK_LEVEL=6 GROUP BY A.WORK_ID, A.WORK_ITEM_CODE, A.WORK_DESCRIPTION;
clear computes
As for the time issue...Have you got the columns in the where clause indexed properly?
Hope this helps.
lnreddy is right I want total of sum(mat_amount) at the end.
sum(mat_amount)
100
200
300
----------
600 total sum(sum(mat_amount))... how do I get this ????
I am using Oracle 8.
Yes, indexes could be a problem I am looking at it.
Bookmarks