안녕하세요.
눈팅만 하고 도움만 받다가 문의를 드립니다.
WITH t AS
(
SELECT '1891' SEQ, 'B1709' RACK, 6 QTY FROM dual UNION ALL
SELECT '1891' SEQ, 'PPPPP' RACK, 6 QTY FROM dual UNION ALL
SELECT '1892' SEQ, 'PPPPP' RACK, 170 QTY FROM dual UNION ALL
SELECT '1892' SEQ, 'QQQQQ' RACK, 5 QTY FROM dual UNION ALL
SELECT '1893' SEQ, 'AAAAA' RACK, 50 QTY FROM dual UNION ALL
SELECT '18A1' SEQ, 'QQQQQ' RACK, 12 QTY FROM dual UNION ALL
SELECT '18A2' SEQ, 'PPPPP' RACK, 12 QTY FROM dual UNION ALL
SELECT '18B0' SEQ, 'QQQQQ' RACK, 210 QTY FROM dual UNION ALL
SELECT '1901' SEQ, 'ZZZZZ' RACK, 66 QTY FROM DUAL
)
SELECT * FROM t;
이 데이터를 SEQ 순서대로 했을때 걸리는 순서대로 SUM 해서 정렬을 하고 싶습니다.
즉 결과값이
RACK | QTY |
B1709 | 6 |
PPPPP | 188 |
QQQQQ | 227 |
AAAAA | 50 |
ZZZZZ | 66 |
고수님들 도와 주십시오.