आप एक CTE
का उपयोग कर सकते हैं एक ROW_NUMBER
के साथ
इस तरह:
WITH CTE AS
(
SELECT UserFK, aDate, aValue,
RN = ROW_NUMBER() OVER (PARTITION BY UserFK ORDER BY aDate DESC)
FROM dbo.TableName
)
SELECT UserFK, aDate, aValue
FROM CTE
WHERE RN = 1