题解 | #查询结果限制返回行数#

查询结果限制返回行数

http://www.nowcoder.com/practice/c7ad0e2df4f647dfa5278e99894a7561

select device_id from user_profile limit 0,2---运行效率更高

select device_id from user_profile limit 2 ---运行效率低

也可结合 limit offset: 一起使用时,limit表示要取的数量,offset表示跳过的数量

select device_id from user_profile limit 2 offset 0 // 跳过0条,从第一条数据开始取,取两条数据 ---运行效率中

select distinct device_id from user_profile limit 0,2

全部评论

相关推荐

点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务