单表查询 语法顺序
select distinct 字段1 ,字段2,字段3 from 库,表
where 条件
group by 分组条件
having 过滤
order by 排序字段
limit n;
单表查询 执行顺序
from
where
group(分组)
having(过滤)
distinct(去重)
select
order by (排序)
limt n(限制)