select cap2 as captain from data group by cap2
union all
select cap3 as captain from data group by cap3
我收到此错误
ORA-12704:字符集不匹配
您能帮我解决这个问题吗
select cap2 as captain from data group by cap2
union all
select cap3 as captain from data group by cap3
我收到此错误
ORA-12704:字符集不匹配
您能帮我解决这个问题吗
看看这是否有帮助。
我认为这是您的情况:
SQL> create table test
2 (cap2 varchar2(10),3 cap3 nvarchar2(10));
Table created.
SQL> insert into test values ('A','B');
1 row created.
这是您当前的查询:
SQL> select cap2 from test
2 union
3 select cap3 from test;
select cap2 from test
*
ERROR at line 1:
ORA-12704: character set mismatch
这可能是您要尝试做的-将to_char
函数应用于nvarchar2
列:
SQL> select cap2 from test
2 union
3 select to_char(cap3) from test;
CAP2
----------------------------------------
A
B
SQL>