我有一个逗号分隔的字符串,我想在语句的"IN"子句中使用它.例如:100,101,102
由于In和"IN"子句我必须引用个别字符串,我使用替换函数:例如:select''''|| replace('100,101,102',',',''',''')|| ''''来自双重;
但是,当我尝试使用上面的输出作为"IN"子句的输入时,上面的查询有效,它不返回任何数据.我只受SQL语句的限制,所以我不能使用PL/SQL代码.请帮助.
select * from employee where employee_number in (
select ''''||replace('100,101,102',',',''', ''')||'''' from dual);
Run Code Online (Sandbox Code Playgroud)
以上不起作用.请让我知道我错过了什么.
oracle ×1