Matching records from two tables

前端 未结 2 1030
余生分开走
余生分开走 2021-01-29 00:30

I have two Tables: ads_info and ads.

I want to match records from two tables.

SQL Schema for ads:

| id |                 title |
|----|----------         


        
2条回答
  •  时光取名叫无心
    2021-01-29 00:58

    Do you want a simple 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.

提交回复
热议问题