mysql 查询排序有关问题 Home » IDC云服务 » mysql 查询排序有关问题 mysql 查询排序问题 mysql 查询排序问题 如 a id a b 1 1 2 2 3 1 3 5 8 4 3 5 我要查询排序值是要 a-b值大的在前 如结果 id a b 2 3 1 1 1 2 4 3 5 3 5 8 select * from table_a order by a-b desc 直接按A-B排序即可 select * from tt order by a-b desc