๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Welcome.
:: DBMS ๐Ÿšฉ/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค SQL ๊ณ ๋“์  kit ํ’€์ด

GROUP BY>์ง„๋ฃŒ๊ณผ๋ณ„ ์ด ์˜ˆ์•ฝ ํšŸ์ˆ˜ ์ถœ๋ ฅํ•˜๊ธฐ

by EunBird 2023. 2. 26.
-- ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”
SELECT MCDP_CD AS '์ง„๋ฃŒ๊ณผ ์ฝ”๋“œ', COUNT(*) AS '5์›”์˜ˆ์•ฝ๊ฑด์ˆ˜'
FROM APPOINTMENT
WHERE APNT_YMD LIKE '2022-05-%'
GROUP BY MCDP_CD
ORDER BY COUNT(*), MCDP_CD;

 

 

728x90

๋Œ“๊ธ€