I am new to SQL+ and Oracle. I am trying to create a cross tabular file. It sums all the ded_code Totals, but does not sum ded_code ANN.
My code looks like this: HELP!!
column EMPLOYEE format 9999999999 heading 'Employee'
COLUMN ANN FORMAT 99999999.99 heading 'Ann'
COLUMN FOUR format 99999999.99 heading 'FOUR'
COLUMN TOTALS format 99999999.99 heading 'Totals'
compute sum of FOUR on employee
compute sum of ANN on employee
compute sum of TOTALS on employee
SUM(DECODE(ded_code, 'ANN', ded_amt,0)) ANN,
SUM(DECODE(ded_code, '4', ded_amt,0)) FOUR,
WHERE check_id IN (SELECT CHECK_ID
WHERE CHECK_DATE = '22-Mar-02')
and ded_code in ('4', '5','403F', '403X', 'ANN')
GROUP by employee