with my_data AS ( select key_value2, ROUND ((( (MAX (AVERAGE) - MIN (AVERAGE)))/1024/1024),2) as AVERAGE from mgmt$metric_daily where target_type = 'osm_cluster' and key_value like 'DATA%' and column_label = 'Total Bytes' and rollup_timestamp >= sysdate-182 group by key_value2 ) select * from my_data pivot ( AVG(AVERAGE) for key_value2 IN ('ASM', 'EILPRD1', 'EILPRDDOV', 'EILPRDSUN', 'NEWDSS02DOV', 'NEWDSS03PRD', 'NEWDSSOAP01', 'NEWDSSOAP04', 'NEWSOA02DOV', 'NEWSOAP01', 'NEWSOAP04', 'NEWTOLTTP01', 'ORCDBAUZ01', 'SBYDSS02DOV', 'SBYDSS02PRD', 'SBYDSS03PRD', 'SBYDSSOAP01', 'SBYSOA02SUN', 'SBYSOAP01', 'SBYSOAP042', 'SBYTOLTTP01', 'STBDSSOAP04', 'WMPRD', 'WMPRDDOV', 'WMPRDSUN') );