日期:2014-05-17  浏览次数:21094 次

多个值,依次like一下。
select * from xxx where name like 'A%'
select * from xxx where name like 'B%'

现在 A% 和 B% 是从其他表里查出来的,就是类似于下边这句的意思。

select * from xxx where name like (select p from yyy)

这里要求name和多个字符串依次like一下,
当yyy表里有多于一行数据时出错,
如何修改这个SQL语句呢?



------解决方案--------------------
select t.* from xxx t,yyy t1 where t.name like '%'||t1.p||'%'

这样应该可以实现,但是效率。。。。。。。