[Programmers] SQL(GROUP BY) - 입양 시각 구하기(1)

DMIS·2022년 3월 2일
0

SQL

목록 보기
17/48
post-thumbnail

문제

풀이

  • 몇 시인지 구하기 위해 hour 함수를 사용하였다.
  • 9시부터 19시까지 각 시간대 별로 구하기위해 where 절에서 between 함수를 사용하였다.
select hour(datetime) as HOUR , count(hour(datetime)) as COUNT
from animal_outs
where hour(datetime) between 9 and 19
group by hour(datetime)
order by hour(datetime)
profile
Data + Math

0개의 댓글