思路:使用WHERE
关键字添加限定条件,并且注意用 >=
、AND
、<=
符号过滤
代码解释:从表user_profile
中取出列device_id
、gender
、age
,并限定年龄为20岁及以上且23岁及以下
SELECT
device_id,
gender, age
FROM
user_profile
WHERE
age >= 20
AND age <= 23;
题目:https://www.nowcoder.com/practice/be54223075cc43ceb20e4ce8a8e3e340?tpId=199&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3DSQL%25E7%25AF%2587%26topicId%3D199
标签:SQL8,profile,20,age,查找,user,device,id,年龄段
来源: https://www.cnblogs.com/tiansz/p/16464509.html