这是我的SQL:
Declare @temp table (Id uniqueidentifier NOT NULL PRIMARY KEY NONCLUSTERED, TADate DateTime)
Insert into @temp SELECT Ta.AccountId, max(Ta.Date) FROM Data Ta
inner join Account TaAC on Ta.AccountId=TaAC.Id
WHERE Ta.FirmId = '7d78f9c2-1604-456a-84f2-4b85cd9da1c4'
and Ta.Date between '2011-09-01' AND '2011-09-30'
GROUP BY Ta.AccountId
SELECT Ta.*
FROM Data Ta
inner join @temp temp on Ta.AccountId=temp.Id AND Ta.Date = temp.TADate;
我想使用Query Over做同样的事情。 答案非常感谢。