sql - 根据另一张表的Column2查询Column1

标签 sql mysql sql-like

我需要这样的东西:

SELECT * FROM Table1 WHERE Name LIKE %Table2.Name%

最佳答案

select <col list>
from table1 t1 inner join table2 t2
on t1.name like concat('%', t2.name, '%')

关于sql - 根据另一张表的Column2查询Column1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2108213/

相关文章:

mysql - 如何在2个表之间创建Mysql View

mysql - 全文搜索前导加无法正常工作

MySQL不想存储unicode字符

php - 想要使用多个术语时查询中 LIKE 子句的顺序

mysql - Sql LIKE 一系列数字

php - MySQL 对一个表字段进行精确词存在检查

javascript - 删除 Node js mysql查询中的斜线

sql - 优化sql查询: check for all rows in table B if any rows in table C reference the same row in table A

mysql - 选择最频繁的

sql - SQL中日期范围内的工作日数