select (a+b) as sum
from table
order by sum

解决方案 »

  1.   

    order by a asc,b desc    (asc 是升序,默认,desc是降序,放在排序字段后面就可以了。)
    查出来如果不是你要的按ab排序的效果,就改用order by b,a
      

  2.   

    dulei115() ,你的方法我试过,提示有语法错误。
    iswear428() ,我试一试你的方法。
      

  3.   

    怎么会有错,下面的不会有错的select a + b
    from table
    order by a + b
      

  4.   

    怎么会有错,这样的SQL也不会有错的
    select *
    from table
    order by a + b
      

  5.   

    哦,是我试错了。
    dulei115() ,iswear428()你们的方法都可以,谢谢。
      

  6.   

    select (a+b) as sum
    from table
    order by sum