是这样的有一个 where MEMBER_ID IN (?) 这个id 是number类型
现在传了一个varchar2 类型 ‘1,2,3 ,4,5’
要怎么定义?来完成查询啊
------解决方案--------------------
where MEMBER_ID IN (
select to_number(substr(ids,
instr(','
------解决方案--------------------
ids, ',', 1, level),
instr(ids
------解决方案--------------------
',', ',', 1, level) -
instr(','
------解决方案--------------------
ids, ',', 1, level))) id
from (select '1,2,3,4,5' ids from dual)
connect by rownum <= length(ids) - length(replace(ids, ',')) + 1
)
可以这么来转换。把select '1,2,3,4,5'这里的字符串换成需要的,不同Id中间用逗号隔开,每个id都要是数字,否则会报错