查询两个表,其中一行与另一行相似

query two tables where one row is like another row

我需要连接两个表,其中一行值应该在另一行内。

t1
f1,f2

t2
f11,f22

query
select * from t1 join t2 on f1=f11
where
f22 LIKE %f2%

这个怎么写?

正确的语法是:

select *
from t1 join
     t2
     on t1.f1 = t2f11
where t2.f22 LIKE concat('%', t1.f2, '%')