select GROUP_NO,sum(valid_Count),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO) from TASK left join (select sum(valid_Count),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,valid_Count,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,valid_Count,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK.TASK_ID=#{task_Id} GROUP BY GROUP_NO
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount,COUNT(GROUP_NO) from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO
group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
select GROUP_NO,sum(valid_Count),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO) from TASK left join (select sum(valid_Count),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,valid_Count,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,valid_Count,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK.TASK_STATE_ID=#{task_State_Id} GROUP BY GROUP_NO
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount,COUNT(GROUP_NO) from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO
group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
select GROUP_NO,sum(valid_Count),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO) from TASK left join (select sum(valid_Count),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,valid_Count,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,valid_Count,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID where TASK.CARD_TYPE=#{card_type} GROUP BY GROUP_NO
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount,COUNT(GROUP_NO) from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO
group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
SELECT TASK.CARD_TYPE AS typeCode,count(CARD_TYPE_ID) AS typeCount,CARD_TYPE_DIC.CARD_TYPE AS typeName FROM TASK
left join (SELECT CARD_TYPE,count(CARD_TYPE_ID),CARD_TYPE_ID FROM CARD_TYPE_DIC GROUP BY CARD_TYPE,CARD_TYPE_ID) CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE