I m tryin to execute the following query but i get an exceed resource error. is there any way i chance the resource limit, or may change my query around....
This is the query:
SELECT YEAR(ACCRUAL_DATE), MONTH(ACCRUAL_DATE), SC, OJ, ONR, OC, ONRMP_ST, OFC, OFST, FFRT, OFFRD, CSNE_CITY, TCND, LE, CT, UNIT_TC_LEN, SPECIAL_EQUIP_CD, COUNT(*), SUM(SET_REV)
FROM tablename
WHERE (MONTH(ACCRUAL_DATE) = MONTH(CURRENT DATE - 3 MONTH) OR
MONTH(ACCRUAL_DATE) = MONTH(CURRENT DATE - 2 MONTH) OR
MONTH(ACCRUAL_DATE) = MONTH(CURRENT DATE - 1 MONTH)) AND
YEAR(ACCRUAL_DATE) BETWEEN YEAR(CURRENT DATE - 13 MONTH) AND
YEAR(CURRENT DATE - 1 MONTH)AND SET_REV <> 0
GROUP BY SC, OJ, ONR, OC, ONRMP_ST, OFC, OFST, FFRT, OFFRD, CSNE_CITY, TCND, LE, CT, UNIT_TC_LEN, SPECIAL_EQUIP_CD, COUNT(*), SUM(SET_REV)ACCRUAL_DATE
ORDER BY 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
This is the query:
SELECT YEAR(ACCRUAL_DATE), MONTH(ACCRUAL_DATE), SC, OJ, ONR, OC, ONRMP_ST, OFC, OFST, FFRT, OFFRD, CSNE_CITY, TCND, LE, CT, UNIT_TC_LEN, SPECIAL_EQUIP_CD, COUNT(*), SUM(SET_REV)
FROM tablename
WHERE (MONTH(ACCRUAL_DATE) = MONTH(CURRENT DATE - 3 MONTH) OR
MONTH(ACCRUAL_DATE) = MONTH(CURRENT DATE - 2 MONTH) OR
MONTH(ACCRUAL_DATE) = MONTH(CURRENT DATE - 1 MONTH)) AND
YEAR(ACCRUAL_DATE) BETWEEN YEAR(CURRENT DATE - 13 MONTH) AND
YEAR(CURRENT DATE - 1 MONTH)AND SET_REV <> 0
GROUP BY SC, OJ, ONR, OC, ONRMP_ST, OFC, OFST, FFRT, OFFRD, CSNE_CITY, TCND, LE, CT, UNIT_TC_LEN, SPECIAL_EQUIP_CD, COUNT(*), SUM(SET_REV)ACCRUAL_DATE
ORDER BY 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17