select * from product where jiage=0 union all select * from product where jiage>0 order by jiage desc
Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End
select * from product where jiage=0 union all order by jiage desc ( 0:你的表的定义有关,是char,nvarcher等,就是'0',要是num等,就是0 甚至是一点小小的错误,如不为空,字段类型不匹配,还有一些莫名奇妙的错误。可能是你没加''注意是英文的。)建议你使用数字类型的字段。
select * from product where jiage=0 union all select * from product where jiage>0 order by jiage desc
不知道softj(天地客人) 方法的速度有没有影响。
Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End 这样好像错了,不知哪位知道如何更改?
Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End 这条语句好,精典
Select id,name,jiage From product Order by (Case When isnull(jiage,0) = 0 then 0 else 1 End) ,jiage desc
Select id,name,jiage from product Order by Case With jiage = 0 then jiage ASC else jiage DESC End我试了试这个语句报with附近有错 不知哪位知道如何更改?急用!
union all
select * from product where jiage>0 order by jiage desc
where jiage=0
union all
order by jiage desc
( 0:你的表的定义有关,是char,nvarcher等,就是'0',要是num等,就是0
甚至是一点小小的错误,如不为空,字段类型不匹配,还有一些莫名奇妙的错误。可能是你没加''注意是英文的。)建议你使用数字类型的字段。
union all
select * from product where jiage>0 order by jiage desc
这样好像错了,不知哪位知道如何更改?
这条语句好,精典
From product
Order by
(Case When isnull(jiage,0) = 0 then 0 else 1 End) ,jiage desc
不知哪位知道如何更改?急用!