尤勒斯的驱魔仪式,股票什么时候开市,巾帼枭雄之义海云天
摘要:
下文讲述case when中多条件的编写方法,如下所示:
实验环境:sql server 2008 r2
case when 多条件编写方法
case when多条件编写语法:
case
when 条件1 and 条件2 then '1'
when 条件1 and 条件2 then '1'
else
end
case when 多条件编写举例
create table [maomao365.com] (keyid int identity, xingbie varchar(100) ) go insert into [maomao365.com] (xingbie)values('1'), ('0'),('1') ,('1'),('2') go select keyid, case when xingbie ='1' or xingbie ='2' then n'性别' when xingbie ='0' then n'未填写!' else '' end as xingbie from [maomao365.com] go truncate table [maomao365.com] drop table [maomao365.com]
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
SQL Server免费版的安装以及使用SQL Server Management Studio(SSMS)连接数据库的图文方法
SQL Server 2017 Developer的下载、安装、配置及SSMS的下载安装配置(图文教程详解)
网友评论