본문 바로가기
언어

데이터 조합 형식

by 땅호720 2024. 7. 10.
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)

'언어' 카테고리의 다른 글

중복 제거  (0) 2024.07.12
format 소수 n번째 자리까지  (0) 2024.07.11
union all  (0) 2024.07.08
percent_rank, ntile  (0) 2024.07.08
비트연산  (0) 2024.07.02