³ë¹«Çö ´ëÅë·É ¹è³Ê
  ±è¼ºÅÂÀÇ Tech Tips(Linux, PHP, Apache, DBMS, Mobile)
  http://www.supersky.pe.kr  
¾È³çÇϽʴϱî? ±è¼ºÅÂÀÔ´Ï´Ù.
Linux, Apache, PHP, Mysql, Mobile °ü·Ã Tech Tips Á¤º¸¸¦ Á¦°øÇÕ´Ï´Ù.
 
<<   2024 Dec   >>
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930311234
1877529 55
  
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 ...  133  134  135  136  137  138  139  140  141 ...  162     next >>