반응형
programmers.co.kr/learn/courses/30/lessons/59413
풀이:
SET @hour := -1;
SELECT (@hour := @hour + 1) as HOUR,
(SELECT COUNT(ANIMAL_ID) FROM ANIMAL_OUTS WHERE HOUR(DATETIME) = @hour) as COUNT
FROM ANIMAL_OUTS
WHERE @hour < 23;
반응형
'Programming > Algorithm' 카테고리의 다른 글
[프로그래머스] - [큐스택] 기능개발 문제 (0) | 2021.05.23 |
---|---|
[30 Days of Code] 0: Hello, World (0) | 2020.10.30 |
[Hackerrank] counting valleys - java (0) | 2020.09.08 |
[Hackerrank] JumpingOnClouds - java (0) | 2020.09.08 |
[Java-알고리즘] Frog Jumps (0) | 2020.05.20 |