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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 can I solve this TOP problem with a query?

Author  Topic 

AndyC
Yak Posting Veteran

53 Posts

Posted - 2006-03-25 : 11:02:45
From a table of soccer results, I want to obtain the most recent say 6 results for each team

Something like

SELECT TOP 6 teamID, gamedate
FROM tblMatch
WHERE teamID = 'Arsenal'
Order by gamedate desc

gives one team

but I cannot seem to set a query that produces
exactly six for each of the twenty clubs or so I want to incorporate

Andrew Clark
www.majorleaguecharts.com

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-25 : 11:58:29
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspx
point 2.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

AndyC
Yak Posting Veteran

53 Posts

Posted - 2006-03-25 : 14:49:45
Thanks
Just what the doctor ordered.
That is a nice set of solutions

Andrew Clark
www.majorleaguecharts.com
Go to Top of Page
   

- Advertisement -