annamalai
Wednesday, September 29, 2010
Select top 1 from each group
Select * from (
select ROW_NUMBER() OVER(PARTITION BY Field1 , Field2 ORDER BY Field3 DESC) AS RowNumber
Field1 , Field2 , Field3
from table1
where
) a where RowNumber = 1
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment