【分类】:限量查询、limit

分析思路

select 查询结果 [distinct 学校]
from 从哪张表中查找数据 [user_profile]
limit 定义输出数据集的行 [前两行]

求解代码

方法一:

用 or

select 
    device_id
from user_profile
where id = 1 or id = 2

方法二:

限量查询

select 
    device_id
from user_profile
limit 2