https://programmers.co.kr/learn/courses/30/lessons/77487

이 서비스에서는 공간을 둘 이상 등록한 사람을 "헤비 유저"라고 부릅니다. 헤비 유저가 등록한 공간의 정보를 아이디 순으로 조회하는 SQL문을 작성해주세요.

-- 코드를 입력하세요
select p.id, p.name, p.host_id
from places p
     ,(SELECT host_id
         from places
     group by host_id
     having count(host_id)>1
     order by 1)sub1
where p.host_id=sub1.host_id


id name host_id
4431977 BOUTIQUE STAYS - Somerset Terrace, Pet Friendly 760849
5194998 BOUTIQUE STAYS - Elwood Beaches 3, Pet Friendly 760849
16045624 Urban Jungle in the Heart of Melbourne 30900122
17810814 Stylish Bayside Retreat with a Luscious Garden 760849
22740286 FREE PARKING - The Velvet Lux in Melbourne CBD 30900122

+ Recent posts