order by case when isnull(a,0)=0 then 10000000 else a end

解决方案 »

  1.   

    order by (isnull(a,0)* -1 ) DESC 
      

  2.   

    不行啊,我的排序字段是enterpriseorder,以下代码让我一条记录都显示不出来
    order by enterpriseorder when isnull(a,0)=0 then 10000000 else a end 
    请大侠继续关注
    谢谢
      

  3.   

    order by (isnull(a,0)* -1 ) DESC 
    为0的还是排在前面了
    请继续关注
      

  4.   

    order by  when isnull(enterpriseorder,0)=0 then 10000000 else enterpriseorder end 

    order by (isnull(enterpriseorder,0)* -1 ) DESC 
      

  5.   

    order by case when enterpriseorder =0 then 2147483647 else enterpriseorder end
      

  6.   

    呵呵,Rewiah(乘长风) 的正确
    结贴
      

  7.   

    错了,现在正确
    order by (isnull(enterpriseorder,0)* -1 )
      

  8.   

    order by (isnull(a,0)* -1 ) DESC 不对0 0
    1 -1
    2 -2desc后的排序是
    0,1,2
      

  9.   

    int从 -2^31 (-2,147,483,648) 到 2^31 - 1 (2,147,483,647) 的整型数据(所有数字)。存储大小为 4 个字节。int 的 SQL-92 同义字为 integer。