一个包括case的sql语句(包含大于号) select case count(*) as c when c>0 then 'x' else 'y' endfrom t_order 如果count()>1返回x,否则返回y,大致这么个意思,但这句sql是不正确的. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select case when count(*) >0 then 'x' else 'y' end as cfrom sysobjects select case when count(*) >0 then 'x' else 'y' end as c from sysobjects up select case when flag>1 then 'X' else 'Y' from (select flag=count(*) from t_order)t select case when count(*)>0 then 'x' else 'y' endfrom t_order SELECT CASE WHEN C>0 THEN 'X' ELSE 'Y' END AS COL FROM (select count(*) as c from t_order )AS T SELECT CASE WHEN C>0 THEN 'X' ELSE 'Y' END AS COL FROM (select LTRIM(count(*)) as c from t_order )AS T select case count(*) when 0 then 'x' else 'y' endfrom tb select case when count(*)=0 then 'x' else 'y' endfrom tb select case when count(*)>0 then 'x1' when count(*)=0 then 'x2' when count(*)<0 then 'x3' else 'y' end as c from sysobjects CASE WHEN 实现多条件分支 select case when count(1)>0 then 'x1' when count(1)=0 then 'x2' when count(1)<0 then 'x3' else 'y' end as c from sysobjects 求解。。。。 sql中join的几种常见用法总结…… 新手关于datetime的问题,谢谢! SQL Compact3.5/4.0 如何调整字段顺序? 快!快!快!谁告诉我,字段不包含是那个关键字,怎么用,在线等!10分,一经解答立即结贴 求一条sql语句? 数据设计问题? 这样的记录该怎么选? report builder权限问题 哪位高手能给我解释一下:ADO与ODBC各自的优缺点? 求sql语句或解决方法 ql2000,表结构发生了变化,怎样在还原数据库的时候只是更新表的结构,而不要覆盖以前的数据?
>0 then 'x'
else 'y' end as c
from sysobjects
select case when count(*)
>0 then 'x'
else 'y' end as c
from sysobjects up
else 'y' end
from t_order
(
select count(*) as c
from t_order )AS T
(
select LTRIM(count(*)) as c
from t_order )AS T
from tb select case when count(*)=0 then 'x' else 'y' end
from tb
when count(*)>0 then 'x1'
when count(*)=0 then 'x2'
when count(*)<0 then 'x3'
else 'y'
end as c
from sysobjects CASE WHEN 实现多条件分支
when count(1)>0 then 'x1'
when count(1)=0 then 'x2'
when count(1)<0 then 'x3'
else 'y'
end as c
from sysobjects