mysql查询包含字符串更高效率的方法
一、LOCATE语句
SELECT `column` from `table` where locate(‘keyword’, `condition`)>0
二、或是 locate 的別名 position
SELECT `column` from `table` where position(‘keyword’ IN `condition`)
三、INSTR语句
SELECT `column` from `table` where instr(`condition`, ‘keyword’ )>0
或者使用find_in_set函数
mysql查询包含字符串(模糊查询)
最新推荐文章于 2025-03-11 12:34:32 发布