对于全模糊的查询,就是 %XX%的形式, 完全可以采用 INSTR 来代替,例如:
SELECT * FROM [TABLE NAME] WHERE [FIELD NAME] LIKE '%XX%';
SELECT * FROM [TABLE NAME] WHERE INSTR([FIELD NAME], 'XX') > 0;
而且,INSTR 还有更有用的功效
,
SELECT * FROM [TABLE NAME] WHERE INSTR('XXXXX', [FIELD NAME]) > 0;
SELECT * FROM [TABLE NAME] WHERE [FIELD NAME] LIKE '%XX%';
SELECT * FROM [TABLE NAME] WHERE INSTR([FIELD NAME], 'XX') > 0;
而且,INSTR 还有更有用的功效
![14.gif](https://i-blog.csdnimg.cn/blog_migrate/ef76661dfbdf045b675cd0e7e572623f.gif)
SELECT * FROM [TABLE NAME] WHERE INSTR('XXXXX', [FIELD NAME]) > 0;