취미와 밥줄사이
[SQL] GROUP BY 문 본문
SQL GROUP BY 문
- GROUP BY문은 "각 국가의 고객 수 찾기"와 같이 동일한 값을 가진 행을 요약 행으로 그룹화합니다.
- GROUP BY문은 하나 이상의 열로 결과 집합을 그룹화하기 위해 집계 함수(COUNT(), MAX(), MIN(), SUM(), AVG()) 함께 자주 사용됩니다.
GROUP BY 문법
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
REFERENCE
https://www.w3schools.com/sql/sql_groupby.asp
SQL GROUP BY Statement
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
'DB' 카테고리의 다른 글
[SQL] EXISTS 연산자 (0) | 2021.11.01 |
---|---|
[SQL] HAVING 절 (0) | 2021.11.01 |
[SQL] UNION 연산자 (0) | 2021.11.01 |
[SQL] Aliases (0) | 2021.11.01 |
[SQL] BETWEEN 연산자 (0) | 2021.11.01 |