您的查询是:
SELECT * FROM CAMPAIGN WHERE 1481125 IN
(select column_name from all_tab_columns where table_name = 'CAMPAIGN' AND data_type='NUMBER')
打破这一点,我们有:
SELECT * FROM CAMPAIGN WHERE 1481125 IN (<a set of numbers>)
和子查询:
select column_name from all_tab_columns
where table_name = 'CAMPAIGN'
AND data_type='NUMBER'
该子查询将返回列名列表,例如
CAMPAIGN_COUNT
CAMPAIGN_ID
CAMPAIGN_NUMBER_OF_SOMETHINGS
因此,您的查询相当于:
SELECT * FROM CAMPAIGN WHERE 1481125 IN
('CAMPAIGN_COUNT', 'CAMPAIGN_ID', 'CAMPAIGN_NUMBER_OF_SOMETHINGS')
您可以看到为什么会出现 ORA-01722 错误?
您需要编写动态 SQL 来实现您的目标。