| | |
|
¿À´Ã |
79 |
¾îÁ¦ |
163 |
ÃÖ´ë |
1,112 |
Àüü |
358,396 |
|
|
| | |
|
ÀÛ¼ºÀÏ : 14-11-29 09:12
[ȦÀοø 6.05.10] ÀÌ·Ð Ãß°¡ ¼³¸í
|
|
±Û¾´ÀÌ :
¿î¿µÀÚ
Á¶È¸ : 5,110
|
sung(bun, point) //Å×À̺í¸í sung, ¹øÈ£ bun, Á¡¼ö point
bun point
100 2
200 1
300 3
400 1
500 3
200 8 <- bun 2°³ Áߺ¹
******************************
<Äõ¸® ¸í·É-1> - HAVING ¾øÀÌ(Á¶°Ç ¾øÀÌ Àü Æ©ÇÃÀ» ´ë»ó)
SELECT bun, COUNT(*) FROM sung GROUP BY bun;
<°á°ú>
100 1
200 2 <- 200¹ø 2°³
300 1
400 1
500 1
<¼³¸í>
°°Àº ¹øÈ£(bun)ÀÇ °³¼ö¸¦ ¼¼¾î¼(COUNT(*)) Ãâ·Â
------------------------------
<Äõ¸® ¸í·É-2> - HAVING ¾øÀÌ(Á¶°Ç ¾øÀÌ Àü Æ©ÇÃÀ» ´ë»ó)
SELECT bun, SUM(point) FROM sung GROUP BY bun;
<°á°ú>
100 2
200 9 <- 200¹ø Á¡¼ö(point)ÀÇ ÇÕ 1+8=9
300 3
400 1
500 3
<¼³¸í>
°°Àº ¹øÈ£(bun)º°·Î Á¡¼öÀÇ ÇÕÀ»(SUM(point))Ãâ·Â
------------------------------
<Äõ¸® ¸í·É-3> - HAVING »ç¿ë
SELECT bun, COUNT(*) FROM sung GROUP BY bun HAVING COUNT(*) >= 2;
<°á°ú>
200 2 <- °°Àº ¹øÈ£°¡ 2°³ ÀÌ»óÀΰÍ
<¼³¸í>
°°Àº ¹øÈ£(bun)ÀÇ °³¼ö¸¦ ¼¼¾î¼(COUNT(*)) Ãâ·ÂÇϵÇ, °°Àº ¹øÈ£°¡ 2ÀÌ»óÀÎ °Í¸¸ Ãâ·Â
------------------------------
<Äõ¸® ¸í·É-4> - HAVING »ç¿ë
SELECT bun, SUM(POINT) FROM sung GROUP BY bun HAVING SUM(POINT) >= 3;
<°á°ú>
200 9
300 3
500 3
<¼³¸í>
°°Àº ¹øÈ£(bun)º°·Î Á¡¼ö ÇÕÀ»(SUM(point)) Ãâ·ÂÇϵÇ, Á¡¼öÀÇ ÇÕÀÌ 3ÀÌ»ó°Í¸¸ Ãâ·Â
------------------------------
È®ÀÎÇغ¸½Ã°í..´Ù½Ã ¹®ÀÇÇØÁÖ¼¼¿ä..
¾Æħ¿¡ ½Ã°£ÀÌ µÇ¾î¼ ¹Ð¸° ´äº¯ÇÏ°í ÀϺ¸·¯ °©´Ï´Ù..
|
|
|