SQL 고득점 Kit - GROUP BY Level2 - 가격대 별 상품 개수 구하기 - mysql

Purple·2022년 10월 27일
0

sql

목록 보기
22/22

https://school.programmers.co.kr/learn/challenges?page=1&languages=mysql&order=recent

select (price div 10000) * 10000 as price_group, count(*) as products
from product
group by price div 10000
order by price_group asc

나눠지는값 div 나눌값

  • 몫만 출력하는 연산이다.
profile
안녕하세요.

0개의 댓글