https://school.programmers.co.kr/learn/courses/30/lessons/131530
프로그래머스 - 가격대 별 상품 개수 구하기
SELECT (PRICE DIV 10000)*10000 AS PRICE_GROUP, COUNT(*) AS PRODUCTS FROM PRODUCT
GROUP BY PRICE_GROUP
ORDER BY PRICE_GROUP;
SELECT (
CASE
WHEN PRICE < 10000 THEN 0
ELSE TRUNCATE(PRICE, -4)
END
) AS PRICE_GROUP , COUNT(PRODUCT_ID)
FROM PRODUCT
GROUP BY PRICE_GROUP
ORDER BY PRICE_GROUP;
7 div 2 -> 3
7 / 2 -> 3.xxxx
MOD(7,2)
7 MOD 2
7 % 2