语法:select * |{[DISTINCT] column | expression [alias],...} FROM table;

select * from departments;

select department_id,location_id from departments;

运算符:+ - * /

select last_name,salary,salary + 300 from employees;

select last_name,salary,12*salary+100 from employees;

select last_name,salary,12*(salary+100) from employees;

null:空

select last_name,job_id,salary,commission_pct from employees;

select last_name,12*salary*commission_pct from employees;

alias:别名

select last_name as name,commission_pct comm employees;

select last_name "Name",salary*12 "Annual Salary" from employees;

||连接符

select last_name||job_id as "Employees" from employees;

q引用符

select department name ||

    q'[,it's assigned manager id:]'

    || manager_id

    AS "Department and manager_id"

from departments;


去重:DISTINCT

select DISTINCT department_id from employees;