select * from product where jiage=0
union all 
select * from product where jiage>0 order by jiage asc

解决方案 »

  1.   

    select * from product where jiage=0
    union all 
    select * from product where jiage>0 order by jiage desc
      

  2.   

    Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End
      

  3.   

    select * from product
    where jiage=0
    union all  
    order by jiage desc
    ( 0:你的表的定义有关,是char,nvarcher等,就是'0',要是num等,就是0
    甚至是一点小小的错误,如不为空,字段类型不匹配,还有一些莫名奇妙的错误。可能是你没加''注意是英文的。)建议你使用数字类型的字段。
      

  4.   

    select * from product where jiage=0
    union all 
    select * from product where jiage>0 order by jiage desc
      

  5.   

    不知道softj(天地客人) 方法的速度有没有影响。
      

  6.   

    Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End
    这样好像错了,不知哪位知道如何更改?
      

  7.   

    Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End
    这条语句好,精典
      

  8.   

    Select id,name,jiage 
    From product 
    Order by 
    (Case When isnull(jiage,0) = 0 then 0 else 1 End) ,jiage desc
      

  9.   

    Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End我试了试这个语句报with附近有错
    不知哪位知道如何更改?急用!
      

  10.   

    case   when   else   end case 搭配 when 而不是 with