开发者

Getting top 1 record for each project

开发者 https://www.devze.com 2023-02-25 18:37 出处:网络
Project-开发者_StackOverflow中文版 ID,Name ProjectProgress - ID,ProjectID,ProgressID, Date I need to get the Top 1 record for each Project, however i keep hitting a brick wall, does anyone have an i
Project-开发者_StackOverflow中文版 ID,Name
ProjectProgress - ID,ProjectID,ProgressID, Date

I need to get the Top 1 record for each Project, however i keep hitting a brick wall, does anyone have an idea how i can achieve this, I am trying to return

ProjectName, ProgressID


You didn't describe how to determine which record is the TOP 1. Is it the most recent date for each ProjectID?

If so, tell us what more you need after starting with this:

SELECT ProjectID, Max([Date]) AS MaxOfDate
FROM ProjectProgress
GROUP BY ProjectID;
0

精彩评论

暂无评论...
验证码 换一张
取 消