题解 | #查询结果限制返回行数#
查询结果限制返回行数
http://www.nowcoder.com/practice/c7ad0e2df4f647dfa5278e99894a7561
查询结果:device_id 数据
查询条件:device_id的前两个用户数据
限制查询结果显示的行数: limit 位置偏移量, 行数
select device_id
from user_profile
limit 0,2 // 返回前两行
// 第0+1行开始,返回2行,第0+2行结束
或
select device_id
from user_profile
where id in ('1','2')