答案1
更新查询
因此,下面的 SQL 返回,但运行时间太长(10 分钟),并且一旦访问显示数据它就会崩溃?有人可以帮忙吗?
SELECT TestDataset.ID, TestDataset.OperatorID, TestDataset.DTCreated,( SELECT TOP 1 t2.DtCreated FROM TestDataSet WHERE t2.OperatorID = TestDataset.OperatorID AND t2.DtCreated < TestDataset.DtCreated ORDER BY t2.DtCreated,t2.ID) as PreviousTransaction ,Minute([DtCreated]-[PreviousTransaction]) AS Minutes FROM TestDataset ORDER BY TestDataset.OperatorID, TestDataset.DTCreated;