表如下TABLE1
colIsAdmin bit not null查询:SELECT * FROM Table1 的结果如下:colIsAdmin
0
0
0
1
1
0我想让结果显示为:colIsAdmin
不是管理员
不是管理员
不是管理员
管理员
管理员
不是管理员这个sql咋写?谢谢了~~
colIsAdmin bit not null查询:SELECT * FROM Table1 的结果如下:colIsAdmin
0
0
0
1
1
0我想让结果显示为:colIsAdmin
不是管理员
不是管理员
不是管理员
管理员
管理员
不是管理员这个sql咋写?谢谢了~~
when colIsAdmin=0 then '管理员'
else '非法数据' end
as colIsAdmin from Table1
select isnull(nullif(replace(colIsAdmin,'0','不是'),'1'),'') + '管理员' from tb
搞的有理~~~
支持你一下,哈哈!
select case when colIsAdmin=0 then '不是管理员' else '管理员' end as colIsAdmin from Table1
(colIsAdmin char(10))
go
insert into table1(colIsAdmin) values(0)
insert Table1 values(0)
insert Table1 values(0)
insert Table1 values(1)
insert Table1 values(1)
insert Table1 values(0)select case when colIsAdmin=0 then '不是管理员' else '管理员' end as colIsAdmin from Table1
杂都没这样写的内?