-1
SELECT district_lease,
first_proddate,
prod_cnt,
@rt := @rt + prod_cnt AS api_cnt
FROM Temp1 a
JOIN (SELECT @rt := 0) r
GROUP BY district_lease, first_proddate
ORDER BY district_lease, first_proddate ;
此查詢組district_lease,first_proddate但運行總計爲完整的查詢計算運行總計未運行,各組的總。我們想要的是每個district_lease和first_proddate的運行總數。如何選擇查詢
可以請你分享一些數據和預期的結果? – AK47 2014-09-10 09:17:34