본문 바로가기

algorithm

[programmers] MySQL - Lv.4 그룹별 조건에 맞는 식당 목록 출력하기 (join)

문제

 

 

 

 

풀이

 

select a.member_name, b.review_text, 
       date_format(b.review_date, '%Y-%m-%d') review_date
from member_profile a join rest_review b
    on a.member_id = b.member_id
where a.member_id like (select member_id
                        from rest_review
                        group by member_id
                        order by count(member_id) desc
                        limit 1)                        
order by 3, 2;