½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
javascript
php
ASP
css
mysql
html
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 32 | Á¶È¸¼ö 499 | µî·ÏÀÏ 2000-12-27 15:26:21

´Ð³×ÀÓ

vopos

À̸ÞÀÏ

vopos@happycgi.com

Á¦¸ñ

[´äº¯] [´äº¯] [´äº¯] ¾ÈµÇ¿©..¤Ð¤Ð Á»´õ ÀÚ¼¼ÇÑ Áú¹®ÀÓ´Ù.
³»¿ë
¾È³çÇϼ¼¿ä, HappyCGI ÆÀÀÇ voposÀÔ´Ï´Ù.


>white´Ô²²¼­ °¥ÄÑÁֽŰÍÀº ¿¡·¯ ¸Þ¼¼Áö°¡ ³ª¿ä..
>GROUP BY R.id_gongµÚ¿¡ ºÙ¿©µµ ¿¡·¯°¡³ª¸ç....LIMIT 5µÚ¿¡ ºÙ¿©µµ ¿¡·¯°¡ »ý°Ü¿ä..Ȥ COUNT´Â µé¾î°¥ ¼ö ¾ø´Â°Ô ¾Æ´Ñ°¡ÇØ¿ä..
>
>[
SQL ±¸¹®¿¡ ¿À·ù°¡ ÀÖ½À´Ï´Ù.
¿¡·¯ °°À¾´Ï´Ù. (
ORDER BY COUNT desc
¸í·É¾î ¶óÀÎ 2)]
>
>ÀÌÄÉ¿ä....¤Ð¤Ð...
>
>±¸·¡¼­ Á»´õ ÀÚ¼¼ÇÏ°Ô Àû¾ú¾î¿ä...
>Á¦ Àǵµ´Â... °øµ¿±¸¸ÅÁß Á¦Ç°À» ÃßõÇÏ´Â Äڳʰ¡ Àִµ¥ ÃßõÀ» ÇÏ¸é ±× ÃßõÇÑ ³»¿ëÀ» ºñ±³ÇÏ¿© ±× °ªµéÁß °¡Àå Å« °ÍºÎÅÍ ºÒ·¯¿À°Ô ÇÒ·Á°í ÇÕ´Ï´Ù.
>
>$que1 = "SELECT S.a_name,COUNT(R.id_gong)
>FROM gong_result R , gong_poll S
>WHERE S.id_gong = R.id_gong GROUP BY R.id_gong LIMIT 5";


COUNT(R.id_gong) À» alias ½ÃÅ°½Ã´Â°É ºü¶ß¸®½Å°É·Î º¸À̴µ¥ ÀÌ·¸°Ô¿ä.
COUNT(R.id_gong) as count

alias ½ÃÅ°Áö ¾ÊÀ¸¸é Á¤·Ä½Ãų¶§ Ä÷³À̸§À» ¸í½ÃÇÒ¼ö°¡ ¾ø°Ú½À´Ï´Ù.

GROUP BY clause ´ÙÀ½¿¡ ORDER BY count DESC, LIMIT 5 ÇÏ½Ã¸é µÉ°Å¿¡¿ä.

$sql = "SELECT S.a_name, COUNT(R.id_gong) as count
FROM gong_result R, gong_poll S
WHERE S.id_gong = R.id_gong GROUP BY R.id_gong ORDER BY count DESC LIMIT 5";


>µÎ°³ÀÇ Å×À̺íÀ» ºñ±³Çϸç DB¸¦ ºÒ·¯¿À°ÔÇÏ´Â Äõ¸®ÀÔ´Ï´Ù..
>µÎ°³ÀÇ Å×À̺íÁß °øÅëÀ¸·Î µé¾î°¡´Â Ä®·³(id_gong)À» ºñ±³ÇÏ¸ç °ªÁß Å« °Í ´Ù¼¸°³¸¦ ºÒ·¯¿Ã·Á°í ÇÕ´Ï´Ù......
>
>white´Ô...ºÎŹµå·Á¿ä....
>

´Ù½Ã ½ÃµµÇغ¸¼¼¿ä. ^^ °¨»çÇÕ´Ï´Ù.

- vopos
Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û [Áú¹®] DOSâ¿¡¼­´Â º¸À̴µ¥ ÆäÀÌÁö¿¡¼­´Â ¾Èº¸¿©¿ä!? ÄÊ~! 2000-12-27 11:10:45
´ÙÀ½°Ô½Ã±Û php ¿¡¼­... 2000-12-27 17:03:08