프로그래머스/level 3

[프로그래머스] 헤비 유저가 소유한 장소 (MySQL)

binaryJournalist 2021. 8. 10. 18:20
반응형

 

출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges

 

 

 

 

MySQL 문제들은 아쉽게도 점수가 없어 순위에 영향을 주지 않는다.

 

SELECT ID, NAME, HOST_ID
FROM PLACES
WHERE HOST_ID IN (
    SELECT HOST_ID
    FROM PLACES
    GROUP BY HOST_ID
    HAVING COUNT(*) > 1
)
ORDER BY ID ASC;

 

 

 

참고: https://thispointer.com/mysql-select-where-count-is-greater-than-one-solved/

 

MySQL Select where Count is greater than one [Solved] – thispointer.com

In this article, we will be looking into the count() function with select statement and conditions. Table of Contents Select where count is greater than one : using HAVING ClauseSelect where count is greater than one : using JOINSSelect where count is grea

thispointer.com

 

 

반응형