mysql基础 Like关联查询
// mysql中使用concat连接字符串 select t1.id, t1.title, t2.keyword from t1 inner join t2 on t1.title like concat(‘%‘, t2.keyword, ‘%‘); 其它思路:exists(是否存在)、regexp(正则)、instr(字符串包含) select distinct t1.title from t1 , t2 where instr(t1.title,t2.keyword); select distinct t1.title from t1 inner join t2 on t1.title regexp t2.keyword; select * from t1 where exists (select keyword from t2 where t1.title regexp keyword); select * from t1 where exists (select keyword from t2 where t1.title like concat(‘%‘,keyword,‘%‘));
https://blog.csdn.net/bbirdsky/article/details/26054971
相关推荐
xiaobaif 2020-06-14
weikaixxxxxx 2020-06-13
CosEmon 2020-05-15
lijiawnen 2020-05-01
暗夜之城 2019-09-01
冷月醉雪 2015-02-06
IdiotXue 2012-07-06
hyfound 2018-10-18
hyfound 2018-06-30
小树不倒我不倒 2019-01-30
zhenlq 2009-12-03
ApacheMySQL 2019-04-18
rmrfmysql 2019-04-15
onlyquan 2019-04-15
MySQLl 2019-04-14
rmrfmysql 2019-04-12
MySQLqueen 2019-04-08