我的表结构是..
A_TEXT(ID number,name varchar2)
POLICY_INFO (PI_ID number,relation_id varchar2)
我有这样的查询。
SELECT * FROM A_TEXT A WHERE a.name = 'test' OR a.ID IN
(SELECT TO_NUMBER(RELATION_ID )
FROM POLICY_INFO
)
当我尝试执行查询时,我得到了 Invalid Number 异常。如果您稍微修改查询 Like :
SELECT * FROM A_TEXT A WHERE a.name = 'test' OR TO_CHAR(a.ID) IN
(SELECT RELATION_ID
FROM POLICY_INFO
)
它执行得很好。