언어

데이터 조합 형식

땅호720 2024. 7. 10. 14:36
select id, FISH_NAME, LENGTH
from fish_info i
join FISH_NAME_INFO n
on i.FISH_TYPE=n.FISH_TYPE
where (i.fish_type, length) in (select fish_type, max(ifnull(length, 10))
                                from fish_info
                                group by fish_type)