题解 | #查找除复旦大学的用户信息#

查看学校名称中含北京的用户

http://www.nowcoder.com/practice/95d9922b1e2a49de80daa491889969ee

字符匹配 1、_ :匹配一个字符 例如:查找姓张且名字为三个字的学生信息 select * from student where name like '张__'

2、%:匹配0个或多个字符串 例如:查找姓张的学生的信息 select * from student where name like '张%

3、[]匹配框中的任意一个字符 例如查找姓李、张、宋的学生信息 select * from student where name like '[张李宋]%'

4、不匹配[]中的字符 例如找出除姓张、唐之外的学生信息 select * from student where name like '[^张唐]%'

5、查询姓名中第二个字为大或小的学生信息 seletc * from student where name like '_[小大]%'

全部评论
括号里面是或,你这样相当于北或京,肯定错
点赞 回复 分享
发布于 03-27 16:23 河南
为什么SELECT device_id, age, university FROM user_profile WHERE university LIKE '[北京]%';查询到的是空啊
点赞 回复 分享
发布于 2023-12-12 15:48 四川

相关推荐

点赞 评论 收藏
分享
评论
84
3
分享

创作者周榜

更多
牛客网
牛客企业服务