[프로그래머스, 293261] 물고기 종류 별 대어 찾기 (mysql)
Problem Solving/Programmers

[프로그래머스, 293261] 물고기 종류 별 대어 찾기 (mysql)

728x90

https://school.programmers.co.kr/learn/courses/30/lessons/293261

 

프로그래머스

SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

728x90

select fi.id as id, fni.fish_name as fish_name, length
from fish_info as fi
left join fish_name_info as fni
on fi.fish_type = fni.fish_type
where (fi.fish_type, length) in (
    select fish_type, max(length)
    from fish_info
    group by fish_type
);
728x90