³ë¹«Çö ´ëÅë·É ¹è³Ê
  ±è¼ºÅÂÀÇ Tech Tips(Linux, PHP, Apache, DBMS, Mobile)
  http://www.supersky.pe.kr  
¾È³çÇϽʴϱî? ±è¼ºÅÂÀÔ´Ï´Ù.
Linux, Apache, PHP, Mysql, Mobile °ü·Ã Tech Tips Á¤º¸¸¦ Á¦°øÇÕ´Ï´Ù.
 
<<   2005 Oct   >>
S M T W T F S
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
1857915 303
  
DNS Powered by DNSEver.com
  ++ MySQL GROUP BY ¿Í °°ÀÌ »ç¿ëµÇ´Â ÇÔ¼ö  -  2005/10/22 09:42
- COUNT(expr) : GROUP BY ·Î ¹­ÀÎ ºÎºÐ¿¡ ´ëÇÑ Çհ踦 ¹ÝȯÇÑ´Ù.
- ¿¹ : select student.student_name,COUNT(*)
from student,course
where student.student_id=course.student_id
GROUP BY student_name;
- Âü°í : ÇÑ°³ÀÇ Å×ÀÌºí¿¡ ´ëÇØ, WHERE ÀýÀÌ ¾ø´Â °æ¿ì COUNT(*) °¡ ÃÖÀûÈ­ µÇ¾î ÀÖ¾î ¸Å¿ì ºü¸£´Ù.
- ¿¹ : select COUNT(*) from student;

- AVG(expr) : GROUP BY ·Î ¹­ÀÎ ºÎºÐ¿¡ ´ëÇÑ Æò±Õ°ªÀ» ¹ÝȯÇÑ´Ù.
- ¿¹ : select student_name, AVG(test_score)
from student
GROUP BY student_name;

- MIN(expr) : GROUP BY ·Î ¹­ÀÎ ºÎºÐ¿¡¼­ ÃÖ¼Ò°ªÀ» ¹ÝȯÇÑ´Ù.
- MAX(expr) : GROUP BY ·Î ¹­ÀÎ ºÎºÐ¿¡¼­ ÃÖ´ë°ªÀ» ¹ÝȯÇÑ´Ù.
- ¿¹ : select student_name, MIN(test_score), MAX(test_score)
from student
GROUP BY student_name;
- Âü°í : expr ¿¡´Â ¹®ÀÚ¿­ÀÌ µé¾î°¥¼ö ÀÖÀ¸¸ç, ±×·²°æ¿ì ¹®ÀÚ¿­ ±æÀÌÀÇ ÃÖ¼Ò/ÃÖ´ëÀÎ °ªÀ» ¹ÝȯÇÑ´Ù.

- SUM(expr) : GROUP BY ·Î ¹­ÀÎ ºÎºÐ¿¡ ´ëÇÑ Çհ踦 ¹ÝȯÇÑ´Ù.
- ÁÖÀÇ : ÇØ´çÇÏ´Â row °¡ Çϳªµµ ¾øÀ»°æ¿ì NULL À» ¹ÝȯÇÑ´Ù.






      << prev     1  2  3  4  5  6  7     next >>