答案 0 :(得分:1)
你的标题是"最新的"但是你指定了第1行和第1行。 3。 根据您的需要将MAX切换到MIN。
;WITH cte
AS
(SELECT id,MAX([date]) AS [Date] FROM MyTable GROUP BY ID)
SELECT
A.*
FROM
MyTable A
INNER JOIN cte B
ON A.ID = B.ID
AND A.[Date] = B.[Date]
;