首页 > 数据库技术 > 详细

MySQL比like语句更高效的写法locate position instr find_in_se

时间:2015-10-26 20:55:30      阅读:328      评论:0      收藏:0      [点我收藏+]
SELECT `column` from `table` where locate(‘keyword‘, `condition`)>0; // LOCATE(substr,str,pos);locate 多一个起始位置的参数
SELECT `column` from `table` where position(‘keyword‘ IN `condition`);
SELECT `column` from `table` where instr(`condition`, ‘keyword‘)>0;
SELECT `column` from `table` where find_in_set(‘keyword‘, `condition`);
SELECT * FROM test WHERE pnum REGEXP ‘(3|9)‘;// 正则查找 或



MySQL比like语句更高效的写法locate position instr find_in_se

原文:http://my.oschina.net/liufeng815/blog/522272

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!