like与通配符搭配使用进行模糊查询
通配符
- % 表示任意多个字符
- _ 表示任意单个字符
#用户名中包含a的
select * from user where name like '%a%'
#用户名中第二个字符为a的
select * from user where name like '_a%'
#用户名中第二个字符为_的(需要使用转义字符)
select * from user where name like '_\_%'
https://zhhll.icu/2020/数据库/关系型数据库/MySQL/基础/6.like语句/
本文由mdnice多平台发布
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。