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 as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount 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 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 as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount 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 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 as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount 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