코딩테스트/SQL
[SQL] 프로그래머스 조건에 맞는 사용자와 총 거래금액 조회하기
유(YOO)
2023. 10. 5. 22:20
https://school.programmers.co.kr/learn/courses/30/lessons/164668
SELECT
USER_ID, NICKNAME, SUM(PRICE) AS TOTAL_SALES
FROM USED_GOODS_USER A
JOIN USED_GOODS_BOARD B
ON A.USER_ID = B.WRITER_ID
WHERE STATUS = "DONE"
GROUP BY A.USER_ID
HAVING TOTAL_SALES >= 700000
ORDER BY TOTAL_SALES ASC;