我想找到每个ID和分配组的最大时间戳。
DROP TABLE IF EXISTS #SUM1filter1 SELECT [CaseID],[Assignment group],max(Timestamp) as [last reading] INTO #SUM1filter1 from #calculatedw where [Workload per activity] = 1 OR [Workload per activity] = -1 GROUP BY [CaseID], cast((Timestamp) as date), [Assignment group]