我的SQL Server表看起來以下如何獲得重複的記錄在集團通過
Id Date Msg
1 01-01-2015 A
1 02-01-2015 B
2 03-01-2015 C
我想編寫一個查詢得到結果如下
Id Date Msg
1 02-01-2015 B
2 03-01-2015 C
我想
SELECT Id,Max(Date) , Msg
Group By Id, Msg
這也會返回我的第一行。我想爲特定ID的最大日期消息。
任何建議,請
您不能選擇它然後 – InTheWorldOfCodingApplications