Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Select only a few rows for group

Author  Topic 

luishorta
Starting Member

1 Post

Posted - 2009-11-25 : 21:13:04


Hi,

i'm sorry if this is not the place for posting this question.. but I hope so...

is there a SQL statment to implement a way of selecting the top n row of each group (n is a external variable)?
lets say that I want to get the 2 fasted runners of each clube? is it possible?

Its very important for me to know this.
thank you for your help.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-26 : 01:23:13
Refer this
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/09/12/return-top-n-rows.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -