数据库语句的基本步骤 挑选数据源 from join 过滤结果集 where 分组 group by 聚合函数计算 比如max 过滤分组 having 计算所有表达式 排序 order by 挑选结果列 select