无法使用非数字列连接两个表? ORA-01722

时间:2022-12-20 15:23:16

I would like to check, is it possible to left join two tables using a non numeric column?

我想检查一下,是否可以使用非数字列连接两个表?

i.e. where descriptions_cd is a varchar(10) and table_cd is a varchar(10):

即,description_cd是varchar(10),table_cd是varchar(10):

   SELECT * 
     FROM descriptions d 
LEFT JOIN tables t ON t.table_cd = d.descriptions_cd;

This SQL seems to be giving an ora-01722 error. This is in Oracle 9i.

这个SQL似乎给出了ora-01722错误。这是在Oracle 9i中。

2 个解决方案

#1


1  

Can you check values of one of these column contain only numeric data (even if the volumn type is varchar) ?

你能检查其中一列的值只包含数值数据(即使volumn类型是varchar)?

#2


1  

ok, table_cd is not numeric. that explains.

好的,table_cd不是数字。这解释了。

#1


1  

Can you check values of one of these column contain only numeric data (even if the volumn type is varchar) ?

你能检查其中一列的值只包含数值数据(即使volumn类型是varchar)?

#2


1  

ok, table_cd is not numeric. that explains.

好的,table_cd不是数字。这解释了。