आप रैंकिंग फ़ंक्शन का उपयोग कर सकते हैं और एक सामान्य तालिका व्यंजक ।
WITH e AS
(
SELECT *,
ROW_NUMBER() OVER
(
PARTITION BY ApplicationId
ORDER BY CONVERT(datetime, [Date], 101) DESC, [Time] DESC
) AS Recency
FROM [Event]
)
SELECT *
FROM e
WHERE Recency = 1