思路:题目的关键信息是“只需要查看前2个用户明细设备ID数据”,那么就先取出所有用户的设备ID数据,然后再限定前两个数据的条件
代码解释:从表user_profile
中取出列device_id
,并限制唯一标识的id
为前两条
SELECT
device_id
FROM
user_profile
WHERE
id = 1
OR id = 2;
题目:https://www.nowcoder.com/practice/c7ad0e2df4f647dfa5278e99894a7561?tpId=199&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3DSQL%25E7%25AF%2587%26topicId%3D199
标签:返回,profile,题目,SQL4,id,user,device,查询,ID
来源: https://www.cnblogs.com/tiansz/p/16464501.html