最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在select语句中使用top的一些小技巧
时间:2022-06-30 09:31:53 编辑:袖梨 来源:一聚教程网
It's well-known.Microsoft SQL Server 7.0增加了一个语句top,可以限制返回的记录数。但是在使用的时候,有时候会遇到一些问题。
比如希望返回前三名的比分,但是第三名有并列的,使用select top 3 * from table order by score的话就只能返回三条记录,在这样的情况下,就可以使用select top 3 with ties * from table order by score
还有,有的时候我不希望出现重复的记录,那么可以使用select distinct top 3 * from table order by score
比如希望返回前三名的比分,但是第三名有并列的,使用select top 3 * from table order by score的话就只能返回三条记录,在这样的情况下,就可以使用select top 3 with ties * from table order by score
还有,有的时候我不希望出现重复的记录,那么可以使用select distinct top 3 * from table order by score
相关文章
- 俄罗斯搜索引擎官方主站直达-俄罗斯搜索引擎移动端免登入口 03-15
- 茄子漫画极速下载-茄子漫画v5.2.44免费畅读 03-15
- msn中文网首页快速入口-msn官网首页一键直达 03-15
- WhatsApp网页版登录-WhatsApp网页版在线体验 03-15
- ao3网页版快捷登录-AO3网页版一键登录入口 03-15
- 漫蛙manwa防走失官网asia-漫蛙manwa2防走失入口 03-15