정렬
SELECT first_name, salary
FROM employees
ORDER BY salary ASC;
SELECT first_name, salary
FROM employees
ORDER BY salary DESC;
-- 입사순으로 정렬, 급여 역순
SELECT hire_date, salary, job_id
FROM employees
ORDER BY hire_date ASC, salary DESC;
SELECT a, b, c AS d
SELECT employee_id, first_name, salary * 12 AS annsal
FROM employees
-- ORDER BY salary * 12 DESC;
ORDER BY annsal DESC;
: salary * 12를 annsal로 명칭을 정함
DISTINCT : 중복 생략
'SQL Developer' 카테고리의 다른 글
[SQL Developer] SELECT 1 (0) | 2022.05.23 |
---|---|
[SQL Developer] (0) | 2022.05.04 |
댓글