使用instr,like,locate进行模糊查询
SELECT c.material_name from epc_inventory c WHERE c.material_name LIKE concat("%","玻璃","%");
SELECT c.material_name from epc_inventory c WHERE c.material_name LIKE "%玻璃%";
SELECT c.material_name from epc_inventory c WHERE instr(c.material_name,"玻璃")>0 ;
SELECT c.material_name from epc_inventory c WHERE locate("玻璃",c.material_name) ;
使用instr
代替like
查询,可以优化查询速度。
网友评论