原始表数据
搜索结果
排序失效
(select * from keywords where name not like '%中国奶粉%') b where
b.name like '%中国%' or b.name like '%奶粉%' ORDER BY b.num desc)
语句参考
关键词匹配:
select *,(case when name like
'%中国奶粉%' then (select max(num)+1 from keywords limit 1) else num
end) as new_num from keywords where name like '%中国奶粉%' or name
like
商品匹配:
select * from sto_goods where goods_name like '%日本原装花王%' or goods_name like '%日本原装%' ORDER BY REPLACE(goods_name,'日本原装花王','');
或者根据关键词查询语句修改也可以。