-- 查询测试表数据
select * from test
-- 对avg列进行升序
select kechenghao,avg as avg from test ORDER BY avg asc
-- 对avg列升序,然后对课程表进行降序,注意 课程表数字的变化
select kechenghao,avg as avg from test ORDER BY avg asc, kechenghao desc
-- 对课程表单独进行降序
select kechenghao,avg as avg from test ORDER BY kechenghao desc
总结:先升序,再降序:根据语法来理解是:先根据avg进行排序,然后再调整avg对应的课程表顺序
select kechenghao,avg as avg from test ORDER BY avg asc, kechenghao desc
原文地址:https://www.cnblogs.com/liyunchuan/p/12642172.html
时间: 2024-10-13 10:20:10