认为你可以用like来做一个内部连接
select p.id, p.pkg
from package p
inner join ad_frameworks adf on p.pkg like CONCAT('%', adf.path_fragment, '%')
--group by p.id, p.pkg
或者正如你所指出的
select *
from package p
inner join ad_frameworks adf on LOCATE(adf.fragment, p.pkg) > 0
或者
select *
from package p
inner join ad_frameworks adf on INSTR( p.pkg,adf.fragment) > 0
或者
select *
from package p
inner join ad_frameworks adf on POSITION(adf.fragment IN p.pkg) > 0
或者
select *
from package p
inner join ad_frameworks adf on REPLACE(p.pkg, adf.fragemnt, '') <> p.pkg
好吧,你的选择很少;)
SqlFiddle