select count(*) as y0_ from PetInfo this_  order by this_.pet_cute+this_.pet_love+this_.pet_strength desc这样的sql语句   我想出来的效果是 一个数字    但是这种语法错误   帮个忙

解决方案 »

  1.   

    select count(*) as NUM from 
    PetInfo A order by A.[pet_cute]+A.[pet_love]+A.[pet_strength] desc 你名字也起得...
      

  2.   

    declare @n int
    select @n=count(*) 
    from PetInfo this_  
    order by (this_.pet_cute+this_.pet_love+this_.pet_strength) desc 
    print @n
      

  3.   


    ---try
    select * from 表
       order by 字段+字段---字段类型一样就可以了
      

  4.   

    select count(*) as y0_ from PetInfo this_  order by  this_.pet_cute+this_.pet_love+this_.pet_strength desc不知道你那个this是表名还是列名啊
      

  5.   

    既然是count()就不能用后面的order by
      

  6.   

    count() 后不要加order by
    聚合成一个了,还排什么序啊