1 from
2, join ..on
3,where,
4,group by
5 having ,
6,select
7,distinct,
8,order by
例如,查询平均工资高于8000的部门的最高和最低 工资
select max(sal),min(sal),depto from emp group by depto having avg(sal) >8000
先 from emp表,有关联 在关联(join..on) ,然后 where条件,接着 group by, having, select ,