๋ฐ˜์‘ํ˜•

๐Ÿ’ SQL (Programmers)/Group By 23

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] SQL ๊ณ ๋“์  Kit : ๊ณ ์–‘์ด์™€ ๊ฐœ๋Š” ๋ช‡ ๋งˆ๋ฆฌ ์žˆ์„๊นŒ

https://school.programmers.co.kr/learn/courses/30/lessons/59040 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr -- ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” SELECT ANIMAL_TYPE, count(*) as count from ANIMAL_INS group by ANIMAL_TYPE order by ANIMAL_TYPE

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] SQL ๊ณ ๋“์  Kit: ๋™๋ช… ๋™๋ฌผ ์ˆ˜ ์ฐพ๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/59041 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr -- ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” SELECT NAME, count(NAME) as COUNT from ANIMAL_INS group by NAME having count(NAME) >= 2 order by NAME

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] SQL ๊ณ ๋“์  Kit: ์ง„๋ฃŒ๊ณผ๋ณ„ ์ด ์˜ˆ์•ฝ ํšŸ์ˆ˜ ์ถœ๋ ฅํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/132202 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr -- ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” SELECT MCDP_CD as '์ง„๋ฃŒ๊ณผ์ฝ”๋“œ', count(APNT_NO) as '5์›”์˜ˆ์•ฝ๊ฑด์ˆ˜' from APPOINTMENT where APNT_YMD between '2022-05-01' and '2022-05-31' group by MCDP_CD order by count(APNT_NO), MCDP_CD;

๋ฐ˜์‘ํ˜•