decode 在Oracle中有,难道在SQL Server中就没有类似的吗?

wangzn1979 2002-09-25 10:40:51
decode 在Oracle中有,难道在SQL Server中就没有类似的吗?
...全文
60 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangzn1979 2002-09-25
  • 打赏
  • 举报
回复
我要这样用啊!
select count(a.no),sum(b.full) full
from student a,
(select no,decode(status,1,1,0) from student) b
where a.no=b.no

用SQL Server中如何写亚!
sqlplus 2002-09-25
  • 打赏
  • 举报
回复
select Case col1
When A then val1
When B then val2
End
from tab1;
jlandzpa 2002-09-25
  • 打赏
  • 举报
回复
case?
alwaystar 2002-09-25
  • 打赏
  • 举报
回复
在SQL和DB2中都用CASE
====★★★★====

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧