https://school.programmers.co.kr/learn/courses/30/lessons/164668
// 6M 30S
SELECT u.USER_ID, u.NICKNAME, SUM(price) AS TOTAL_SALES
FROM USED_GOODS_BOARD b
LEFT JOIN USED_GOODS_USER u ON b.writer_id = u.user_id
WHERE status = 'DONE'
GROUP BY u.USER_ID
HAVING TOTAL_SALES >= 700000
ORDER BY TOTAL_SALES ASC
GROUP BY, HAVING
'Career > TIL' 카테고리의 다른 글
2024-07-14 (0) | 2024.07.14 |
---|---|
2024-07-08 (0) | 2024.07.09 |
댓글