mysql让一张表中字段like另一张表中的字段,sql应该怎么写? 我试了两种方式,都不行 20
mysql让一张表中字段like另一张表中的字段,sql应该怎么写?我试了两种方式,都不行:SELECTa.*,b.first_key,b.second_keyfromk...
mysql让一张表中字段like另一张表中的字段,sql应该怎么写?
我试了两种方式,都不行:
SELECT a.*,b.first_key,b.second_key
from key_data_chufadi a
join key_word b
on a.question_desc like concat("%" ,b.first_key ,"%")
and a.question_desc like concat("%" ,b.first_key ,"%");
2.
SELECT a.*,b.first_word,b.second_word
from test1 a
join key_test b
on a.question_desc like '%' || b.first_word ||'%'
and a.question_desc like '%' || b.second_word || '%'
正确的写法是这样的,也没有好的回答,我的悬赏怎么办?百度好烂
select a.*,
concat(b.id,'-',b.first_key,'-',b.second_key) as contain_key_word
from key_data_ditu a
join key_word b
on a.question_desc like concat('%' ,b.first_key ,'%')
and a.question_desc like concat('%' ,b.second_key ,'%')
where a.create_time < '2017-04-17'
order by a.create_time 展开
我试了两种方式,都不行:
SELECT a.*,b.first_key,b.second_key
from key_data_chufadi a
join key_word b
on a.question_desc like concat("%" ,b.first_key ,"%")
and a.question_desc like concat("%" ,b.first_key ,"%");
2.
SELECT a.*,b.first_word,b.second_word
from test1 a
join key_test b
on a.question_desc like '%' || b.first_word ||'%'
and a.question_desc like '%' || b.second_word || '%'
正确的写法是这样的,也没有好的回答,我的悬赏怎么办?百度好烂
select a.*,
concat(b.id,'-',b.first_key,'-',b.second_key) as contain_key_word
from key_data_ditu a
join key_word b
on a.question_desc like concat('%' ,b.first_key ,'%')
and a.question_desc like concat('%' ,b.second_key ,'%')
where a.create_time < '2017-04-17'
order by a.create_time 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询