[Oracle] sort group by, hash group by 차이
2024. 2. 28.
내부 Algorithm example tableCREATE TABLE t2 (id VARCHAR2(30), amount NUMBER);INSERT INTO t2 VALUES ('A', 10);INSERT INTO t2 VALUES ('C', 5);INSERT INTO t2 VALUES ('B', 1);INSERT INTO t2 VALUES ('B', 2);INSERT INTO t2 VALUES ('A', 3);INSERT INTO t2 VALUES ('C', 1);INSERT INTO t2 VALUES ('A', 7);SELECT id, sum(amount) FROM t2 GROUP BY id; Sort group by전체 테이블을 group by 절의 컬럼으로 정렬 후 sub(amount)..