在select语句中使用top的一些小技巧
来源:岁月联盟
时间:2003-04-10
比如希望返回前三名的比分,但是第三名有并列的,使用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