日期:2014-05-16 浏览次数:20495 次
create table province(name nvarchar2(10)); --name的类型是nvarchar2 insert into province values('天府'); insert into province values('国家首都'); select (CASE WHEN name LIKE '%首都%' THEN ('北京') ELSE (name) END) as name from province; --ORA-12704:字符集不匹配
select (CASE WHEN name LIKE '%首都%' THEN ('北京') ELSE to_char(name) END) as name from province; --ok
select (CASE WHEN name LIKE '%首都%' THEN to_nchar('北京') ELSE (name) END) as name from province; --ok