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

时间:2015-10-26 20:55:30   收藏:0   阅读:330
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)‘;// 正则查找 或



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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!