1.ROLLUP을 사용한다.소계SELECT column1, column2, SUM(some_column) FROM table_name GROUP BY ROLLUP(column1, column2);총계SELECT column1, column2, SUM(some_column) FROM table_name GROUP BY ROLLUP((column1, column2)); 2.UNION을 사용한다.SELECT column1, column2 FROM table_nameUNION ALLSELECT '합계' AS column1, SUM(column2) AS column2 FROM table_name