select * from live_class where title like ‘test_%‘;
解决方案:
-- 下面两种实现的效果一样(个人偏向于第2种,比较符合后台开发的用法习惯):
select * from live_class where title like ‘test/_%‘ escape ‘/‘;
select * from live_class where title like ‘test\_%‘;
【记录】mysql使用like匹配数据时关于通配符的使用误区
原文:https://blog.51cto.com/jiyanle/2392512