我要查找一个集合,单独执行select ''''||replace(Ztdoc,',',''',''')||'''' as urls from sl_hot_sport t where t.Htype='164' and t.id=46,这句会得到'201509/11/121.png','201509/11/add.png','',
如果将这个结果放到语句select e.title, e.fileurl from ss_feature_document e
where e.fileurl in ('201509/11/121.png','201509/11/add.png',''),里是能得到数据的,但是如果这两句结合后。如下
就得不到数据了,求解该怎么办??
select e.title, e.fileurl from ss_feature_document e
where e.fileurl in (select ''''||replace(Ztdoc,',',''',''')||'''' as urls from sl_hot_sport t where t.Htype='164' and t.id=46)
------解决思路----------------------
你查出来的是一个记录,用 in 操作,相当于使用 = 比较符,
你这里要使用 instr 函数。
instr((select .....) , e.fileurl ) > 0 这样的语法, 中间那个 select 是你那一长串 select ... replace 。。