select data_center,
group_name,
count(*)
from (select data_center,
group_name
from runinfo_history
where data_center = 'DEV'
and (ended_status = '16' or ended_status = '32')
and START_TIME >= to_date('20131010100000001', 'YYYYMMDDHH24MISS')
and END_TIME <= to_date('2013112423595959', 'YYYYMMDDHH24MISS')) list
group by data_center,
group_name;
FROM (SELECT data_center, group_name
FROM runinfo_history
WHERE data_center = 'SONY_DEV'
AND (ended_status = '16' OR ended_status = '32')
AND start_time >= TO_DATE('20131010100000001
AND end_time <= TO_DATE('2013112423595959'
GROUP BY data_center, group_name;
remove the "as" from the inline view alias