Home Forums SQL Server 2008 T-SQL (SS2K8) Recursive Query RE: Recursive Query
Geoff A
SSChampion
Points: 11511
More actions
October 15, 2010 at 6:54 am
#1237479
you can do this;
;
WITH
cteFindMax AS
(
SELECT ROW_NUMBER() OVER (PARTITION BY DetailsID, FollowupID ORDER BY FollowupID DESC) AS Occurance,
*
FROM [the name of your table]
)
SELECT *
FROM cteFindMax
WHERE Occurance = 1