select case when status =1 then '完好' else '报废' end 列别名 from 表
系统提示:The Query Designer does not support the CASE SQL construct. 好象不支持这种写法。
select case status when 1 then '完好' else '报废' end as 状态 from tablename
事interbase啊 好像interbase不支持case的那这样alter table table add cid int identity(1,1)select status from (select cid, '完好' status from #t where status=1 union all select cid ,'报废' status from #t where status<>1) a order by a.cid
alter talbe table drop column cid
interbase:select status from (select cid, '完好' status from #t where status=1 union all select cid ,'报废' status from #t where status<>1) a order by a.cidSqlserver: select case when status =1 then '完好' else '报废' end 列别名 from 表
好象不支持这种写法。
from
(select cid, '完好' status from #t where status=1
union all
select cid ,'报废' status from #t where status<>1) a
order by a.cid
interbase:select status
from
(select cid, '完好' status from #t where status=1
union all
select cid ,'报废' status from #t where status<>1) a
order by a.cidSqlserver:
select case when status =1 then '完好' else '报废' end 列别名 from 表