34,590
社区成员
发帖
与我相关
我的任务
分享
select name,(case zt when 0 then N'成功' when 1 then N'不成功' else N'未知' end) zt
from tb
if object_id('tempdb.dbo.#t') is not null drop table #t
create table #t (name varchar(2),zt int)
insert into #t
select 'aa',0 union all
select 'bb',1 union all
select 'cc',0
select name,REPLICATE ('不',zt)+'成功' from #t
select name,(case zt when 0 then N'成功' when 1 then N'不成功' else N'未知' end) zt
from tb
select name as 名称,(case when zt=0 then '成功'
when zt=1 then '不成功'
else '未知'
end) as 状态
from tb
select name,(case zt when 0 then '成功' when 1 then '不成功' else '未知' end) zt
from tb