문제
https://programmers.co.kr/learn/courses/30/lessons/77487
정답
SELECT * FROM PLACES
WHERE HOST_ID IN (SELECT HOST_ID FROM PLACES GROUP BY HOST_ID HAVING count(*) >= 2)
ORDER BY ID
EXISTS
를 사용한 방법
SELECT * FROM PLACES P1
WHERE EXISTS (
SELECT HOST_ID FROM PLACES P2
WHERE P1.HOST_ID = P2.HOST_ID
GROUP BY HOST_ID
HAVING COUNT(ID) >= 2
)
ORDER BY ID ASC;