
5-4 피벗 테이블 실습 시,
먼저 음식점별, 시간별 주문건수 집계하는 쿼리를 만들 때 질문이 있습니다.
select a.restaurant_name,
substring(b.time, 1, 2) hh,
count(1) cnt_order
from food_orders a inner join payments b on a.order_id=b.order_id
where substring(b.time, 1, 2) between 15 and 20
group by 1, 2
1. count 함수를 쓸 때 count(1) 이 아닌 컬럼명으로 사용이 가능한지?
2. where 사용할 때 substring(b.time, 1, 2) 이 아닌 hh 로 적어도 관계 없는지?
