标签:
SELECT
*
FROM
(
SELECT
SUM(secondLuckNumber) - SUM(firstLuckNumber) + count(firstLuckNumber),#每天字段secondLuckNumber的和减每天字段firstLuckNumber加每天字段firstLuckNumber的数量
DATE_FORMAT(time, ‘%Y%m%d‘) days
FROM
records
GROUP BY
days DESC
) AS tmp
LIMIT 30#最新30天
标签:
原文地址:http://www.cnblogs.com/fcheng/p/5714614.html