1)单表查询
单行函数:
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),hire_date,to_char(hire_date,'DAY')
from employees
分组函数:
select max(salary),min(salary),avg(salary),sum(salary) from employees
group by job_id
2)多表查询
自连接
select e.employee_id,e.last_name,m.employee_id,m.last_name
from employees e left join employees m
on e.manager_id=m.employee_id
四张表的连接方式:
select pnr.pnrNum,linkm