我有这个SQL查询:
SELECT *
FROM coa_cook
WHERE grt_tOOK_ID IN (301173, 301202)
和grt_tOOK_ID
表格中的varchar2
数据类型。
我收到此错误:
ORA-01722:无效号码
有人告诉我在它们之间添加引号,因为它是varchar2
数据类型请提示
答案 0 :(得分:4)
该列是varchar(不是数字)。你可以用
SELECT * FROM coa_cook WHERE grt_tOOK_ID IN ('301173','301202')
或
SELECT * FROM coa_cook WHERE TO_NUMBER(grt_tOOK_ID) IN (301173,301202)