SQL大致步骤如下:
select (distinct、top) 列 --第五步
from 表1 left/inner/right join 表2 on 关联条件 --第一步
where 条件判断(and、or、between and) --第二步
group by 分组统计字段 --第三步
having 符合聚合函数条件 --第四步
order by 排序 --第六步