숫자 컬럼의 합계 도출
select sum(column)
from tablename
where condtion;
숫자 컬럼의 평균 도출
select avg(column)
from tablename
where condition
숫자 컬럼 중 가장 작은 수 도출
select min(column)
from table
where condition;
숫자 컬럼 중 가장 큰 수 도출
select max(column)
from tablename
where condition;
그룹화 하여 데이터를 조회
그룹 별 데이터 조회
select column1, column2,...
from tablename
where condition
group by column1 , column2,... #그룹핑할텐데 중복이 제거될거임
order by column1, column2,...
오잉 그럼 중복 제거에 distinct 써도 되는거 아냐?
select distinct column1,column2,...
from tablename
# 그러나 orde by를 쓸 수 없음
조건에 집계함수가 포함되는 경우 where대신 having 사용
select column1, column2,...
from tablename
where condition
group by column1, column2,...
having contion (aggregate functions)
order by column1, column2,...
잘 읽었습니다. 좋은 정보 감사드립니다.