Looks like there is comma missing. Also you need to use the entire case statement in group by not the column name alone SELECT To_date(To_char(BATCH_CREATION_TIME,’YYYY/MM/DD’),’YYYY/MM/DD’) AS CREATION_DATE, Sum(Decode(CDR_ACTUAL_COUNT,NULL,0,CDR_ACTUAL_COUNT)) AS CCOLLECTED, Sum(Decode(CDR_ACTUAL_COUNT,NULL,0,CDR_ACTUAL_COUNT)) – Sum(Decode(CDR_PARSE_ERROR_COUNT,NULL,0,CDR_PARSE_ERROR_COUNT)) – Sum(Decode(CDR_DISCARD_COUNT,NULL,0,CDR_DISCARD_COUNT)) AS COLLECTED, Sum(Decode(VALIDATION_CNR_COUNT,NULL,0,VALIDATION_CNR_COUNT)) + Sum(Decode(VALIDATION_CE_COUNT,NULL,0,VALIDATION_CE_COUNT)) + Sum(Decode(VALIDATION_CR_COUNT,NULL,0,VALIDATION_CR_COUNT)) + Sum(Decode(VALIDATION_NCR_COUNT,NULL,0,VALIDATION_NCR_COUNT)) AS ERRORED, Sum(Decode(VALIDATION_RNC_COUNT,NULL,0,VALIDATION_RNC_COUNT)) + Sum(Decode(VALIDATION_RV_COUNT,NULL,0,VALIDATION_RV_COUNT)) AS PROCESSED , CASE WHEN CDR_SOURCE_TYPE … Read more