SQL如下:
select i.id,i.interceptWords from intercept_words i
where '我今天要用万物生晖这个账号去德玛西亚区域玩游戏,求开黑' like CONCAT('%',i.interceptWords,'%');
执行结果:
...全文
57195打赏收藏
MYSQL模糊查询,通过内容匹配数据库字段
关键字表: 字符串内容:我今天要用【万物生晖】这个账号去德玛西亚区域玩游戏,求开黑。 现在需要通过这个字符串内容,去匹配数据中的列(interceptWords)。找出万物生晖、德玛西亚两列; SQL如下: select i.id,i.interceptWords from intercept_words i where '我今天要用万物生晖这个账号去德玛西亚区域玩游戏,求开黑' like CONCAT('%',i.interceptWords,'%'); 执行结果: