I have two Tables: ads_info and ads.
I want to match records from two tables.
SQL Schema for ads:
| id | title | |----|----------
Do you want a simple join?
join
select a.*, ai.tag, (tag like concat('%', ads.title, '%')) as flag from ads a join ads_info ai on ai.id = a.id;
The flag is, of course, false. It is rather hard to see situations where it would evaluate to true as you have expressed the logic.
flag