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

思路:使用WHERE关键字添加限定条件,并且用正则表达式匹配数据

代码解释:从表user_profile中取出列device_idageuniversity,并限定数据来自学校名称中含有北京的用户

SELECT 
  device_id, 
  age, 
  university
FROM 
  user_profile
WHERE 
  university REGEXP '北京'

题目:https://www.nowcoder.com/practice/95d9922b1e2a49de80daa491889969ee?tpId=199&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3DSQL%25E7%25AF%2587%26topicId%3D199

posted @ 2022-07-11 08:10  tiansz  阅读(47)  评论(0编辑  收藏  举报