SQL select "cross tab" query below:
SELECT CASE concat(SUBSTR(tbl_JC0.JC0_Field1, 1, 3), '0') WHEN '0' THEN CASE concat(SUBSTR(tbl_JC0.JC0_Field1, 1, 2), '0') WHEN '0' THEN 'Total' ELSE concat(SUBSTR(tbl_JC0.JC0_Field1, 1, 2), '0') END ELSE NULL END as "Group", tbl_JC0.JC0_Field1 as "ACCT", SUM(CASE tbl_JC0.TASK_1 WHEN '000449' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0449", SUM(CASE tbl_JC0.TASK_1 WHEN '000550' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0550", SUM(CASE tbl_JC0.TASK_1 WHEN '000551' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0551", SUM(CASE tbl_JC0.TASK_1 WHEN '000552' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0552", SUM(CASE tbl_JC0.TASK_1 WHEN '000553' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0553", SUM(CASE tbl_JC0.TASK_1 WHEN '000554' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0554", SUM(CASE tbl_JC0.TASK_1 WHEN '000555' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0555", SUM(CASE tbl_JC0.TASK_1 WHEN '000556' then tbl_GL10.AMOUNT else 0 end) as "CI 2007-0556", SUM(tbl_GL10.AMOUNT) as "Group Totals" FROM tbl_GL10, tbl_JC0 WHERE tbl_JC0.SUB_SYSTEM = tbl_GL10.SUBSYSTEM AND tbl_JC0.SS_BATCH = tbl_GL10.BATCH AND tbl_JC0.SHEET = tbl_GL10.SHEET AND tbl_JC0.SEQ = tbl_GL10.SEQUENCE AND 'CI' = tbl_JC0.JOB_AREA AND '000000002007' = tbl_JC0.JOB_NO_1 AND (184 < tbl_GL10.S_TRANS_TYPE OR 184 > tbl_GL10.S_TRANS_TYPE) AND NVL('PO', UID) <> tbl_GL10.SUBSYSTEM AND tbl_JC0.JC0_Field1 in ('8111', '8141', '8142', '8176', '8299', '8319', '8333', '8336', '8359', '8369', '8411', '8415', '8459', '8489', '8499', '8519', '8539', '8549', '8557', '8559', '8568', '8571', '8573', '8579', '8589', '8659', '8765', '8766', '8768', '8779', '8833', '8839') AND '31-DEC-2009' >= tbl_GL10.TRANSACTION_DATE AND (tbl_JC0.SUB_SYSTEM < 'PO' OR tbl_JC0.SUB_SYSTEM > 'PO') GROUP BY ROLLUP (SUBSTR(tbl_JC0.JC0_Field1, 1, 2), tbl_JC0.JC0_Field1) ORDER BY SUBSTR(tbl_JC0.JC0_Field1, 1, 2)