본문 바로가기
💻 하나씩 차곡차곡/프로그래머스 (SQL)

[GROUP BY/LEVEL2] 물고기 종류 별 잡은 수 구하기 (MySQL)

by 뚜루리 2024. 11. 27.
728x90
320x100

MySQL

SELECT COUNT(*) AS FISH_COUNT
    , FISH_NAME
FROM FISH_INFO A, FISH_NAME_INFO B
WHERE A.FISH_TYPE = B.FISH_TYPE
GROUP BY FISH_NAME
ORDER BY FISH_COUNT DESC
728x90
320x100