Link to home
Start Free TrialLog in
Avatar of PAGANED
PAGANEDFlag for United States of America

asked on

SQL Server 2008 : Tricky Top 5 Rows Problem

I have a tricky problem I am trying to solve with either Multiple Views or perhaps a Procedure to create a temp table that is returned...
.
There is a Report that Shows the Last 5 comment entries for every Project
.
There is a table :  tblFolderComments
This table has fields :
  -  FolderCommentID (Key)
  -  ProjectID
  -  FolderComment
.
.
These Projects can have any number of comments from 0 to 20+

I need to create something where I only get the most recent 5 [FolderComments] from each Project
.
I thought this was going to be simple ... but it has turned out not to be
.
SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
nevermind, I see what you need now is the same thing but for all ProjectIDs at once, correct?
Avatar of PAGANED

ASKER

Not quite .. I wish it was that easy
.
you are including a ProjectID filter , where I need ALL ProjectIDs
.
All ProjectIDs , not a single one
.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PAGANED

ASKER

Dude .. you are Awesome !
Avatar of PAGANED

ASKER

Tim_cs  :  Awesome quick SQL code