select case count(*) as c
when c>0 then 'x'
else 'y' end
from t_order 如果count()>1返回x,否则返回y,大致这么个意思,但这句sql是不正确的.
解决方案 »
- SELECT TOP(1)后赋值给变量的问题
- 怎样查询最新日期中的最新时间?
- select查询问题,请指点
- 关于数据库表导入的问题,请高手们指教,在线等。。。。。。。。
- 救命啊,SQL Server 发神经了.......
- 用sql表达删除一条时间最早的记录,如何写?
- 求各位IT金鹰帮帮忙急救
- 急!为什么,我在启动SQL Server服务管理器时出错:“由于登录失败而无法启动服务”,发生错误1069-(由于登录失败而无法启动服务,此时
- 在 SQL Server 2000 中如何对一个整数格式化为一字符串 如将 12 格式化为 0012
- 今年寒假该怎么过?
- 求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