Home >Database >Mysql Tutorial >Understand MySQ (Oracle) fuzzy query and use instr() instead of like to improve efficiency
SELECT * FROM msg_list WHERE title LIKE '%涂山%'can be replaced with:
SELECT * FROM msg_list WHERE INSTR(title,'涂山') > 0
项目根目录\thinkphp\library\think\db\Builder.php
MsgList::where([ 'title' => ['instr','涂山']]) ->select();
Related learning recommendations: mysql video tutorial
The above is the detailed content of Understand MySQ (Oracle) fuzzy query and use instr() instead of like to improve efficiency. For more information, please follow other related articles on the PHP Chinese website!