0
可以幫我優化數據庫此查詢(訪問2010),此查詢工作非常緩慢(如果在一個大表使用它):訪問2010 - 優化查詢
SELECT П1.Code, П1.Field, П1.Number, П1.Data, [П1].[Number]-(select П3.Number from [Table] as П3
where П3.Field = П1.Field
and П3.Data = (select Max(Data)
from [Table] as П2
where П2.Field = П1.Field and П1.Data > П2.Data)) AS Difference
FROM [Table] AS П1
ORDER BY П1.Field, П1.Data;
我附上圖片:http://s33.postimg.org/otm859xtb/Table_query.png
鏈接數據庫:http://s000.tinyupload.com/?file_id=06711692152703646964