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.
| Author |
Topic |
|
jyothsna18
Starting Member
1 Post |
Posted - 2010-04-14 : 11:12:31
|
| I have a Table with the below structure.ID SurveyDate FY100 8/25/2009 2009200 8/26/2009 2009300 8/29/2009 2009400 9/1/2010 2010500 9/30/2010 2010i want ID for each Year Max Date. How to get that easily? I need ID only Because this ID i want to use as part of the Sub query. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-14 : 11:33:16
|
Try this:select id from(selectid,row_number() over (partition by FY order by SurveyDate DESC) as rownumfrom Your_Table)dtwhere rownum=1 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|