집계함수

sql developer

COUNT

-- 152p
-- 기본 집계 함수
-- Count(expr) 쿼리 결과 건수, 전체 로우 수 반환 (행 갯수)
SELECT count(*) FROM employees;
SELECT count(employee_id) FROM employees; -- 107

Untitled

DISTINCT

-- DISTINCT
SELECT count(DISTINCT department_id) FROM employees;

SELECT DISTINCT department_id
FROM employees
ORDER BY 1;