본문 바로가기
Data/MySQL

[MySQL] 집계 함수와 산술 함수

by prinha 2020. 12. 15.
728x90
반응형

 

SELECT COUNT(*) FROM copang_main.member; -- 전체 데이터 개수
SELECT COUNT(height) FROM copang_main.member; -- 데이터 개수
SELECT MAX(height) FROM copang_main.member; -- 최댓값
SELECT MIN(height) FROM copang_main.member; -- 최솟값
SELECT AVG(height) FROM copang_main.member; -- 평균
SELECT SUM(height) FROM copang_main.member; -- 합계
SELECT STD(height) FROM copang_main.member; -- 표준편차
SELECT ABS(height) FROM copang_main.member; -- 절대값
SELECT SQRT(age) FROM copang_main.member; -- 제곱근
SELECT CEIL(height) FROM copang_main.member; -- 올림 함수
SELECT FLOOR(height) FROM copang_main.member; -- 내림 함수
SELECT ROUND(height) FROM copang_main.member; -- 반올림 함수
728x90
반응형