WITH T AS ( SELECT 'A' col1, 1 col2 FROM DUAL UNION ALL SELECT 'B' col1, 2 col2 FROM DUAL UNION ALL SELECT 'C' col1, 3 col2 FROM DUAL UNION ALL SELECT 'D' col1, 4 col2 FROM DUAL UNION ALL SELECT 'E' col1, 5 col2 FROM DUAL ) SELECT COL1 , COL2 , SUM(COL2) OVER ( ORDER BY COL2 ) COL3 FROM T ORDER BY COL2
댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.