Saya pikir ini akan melakukan apa yang Anda inginkan.
;WITH X1
AS
(
SELECT SomeDateTime
,GroupID
,ID
,ROW_NUMBER() OVER (PARTITION BY GroupID
ORDER BY SomeDateTime DESC
) AS rn
FROM X
)
SELECT SomeDateTime
,GroupID
,ID
FROM X1
WHERE rn = 1