코딩테스트/SQL
[프로그래머스][MySQL] Lv. 1 한 해에 잡은 물고기 수 구하기
_알파카
2024. 6. 5. 16:41
728x90
문제
https://school.programmers.co.kr/learn/courses/30/lessons/298516
풀이
SELECT count(*) AS FISH_COUNT
FROM FISH_INFO
WHERE DATE_FORMAT(TIME, '%Y') = '2021';
SELECT COUNT(*) AS FISH_COUNT
FROM FISH_INFO
WHERE YEAR(TIME) = 2021;
728x90