日期:2014-05-16  浏览次数:20575 次

ORACLE 简单用CASE转换查询结果

需求:查出来的 数据字段值为1 则转换为是,0则转换为否。

?

有字段:

CASE方式:
select ?case isTrue when 1 then '是' when 2 then '否' else '' end isTrue?

from tbl_xxx

?

完整:

?

select
case t.fmtype when 1 then '是' when 2 then '否' else '' end fmtype
from hisbase.tdrugcode t;