文章目录 一、介绍二、例子 一、介绍 位置:where的后面;limit的前面 -- 单字段 order by 字段名/查询字段的位置 排序规则(asc升序-默认,可省略/desc降序); -- 多字段 order by 字段名1 asc/desc,字段名2 asc/desc; 二、例子 -- 单字段升序 select name,create_time from t_user order by create_time; -- 多字段升序、降序 -- 如果部门id一样,则按照工资降序 select dept_name,sal from t_user order by dept_id,sal desc;