WITH T (dt,c1,c2) AS ( SELECT '2013/06/25 19:20:21', '1', -2.5 FROM DUAL UNION ALL SELECT '2013/06/25 19:20:21', '2', 15.6 FROM DUAL UNION ALL SELECT '2013/06/25 19:20:21', '3', 27.4 FROM DUAL UNION ALL SELECT '2013/06/25 19:20:21', '4', -5.8 FROM DUAL UNION ALL SELECT '2013/06/25 19:21:21', '1', -3.7 FROM DUAL UNION ALL SELECT '2013/06/25 19:21:21', '2', 12.3 FROM DUAL UNION ALL SELECT '2013/06/25 19:21:21', '3', 24.5 FROM DUAL UNION ALL SELECT '2013/06/25 19:21:21', '4', -6.2 FROM DUAL ) SELECT DT "TIME" ,MIN(DECODE(c1, 1 , c2 )) "1" ,MIN(DECODE(c1, 2 , c2 )) "2" ,MIN(DECODE(c1, 3 , c2 )) "3" ,MIN(DECODE(c1, 4 , c2 )) "4" FROM T GROUP BY DT