这是我的查询:
$chart_result = mysql_query("SELECT *
FROM (SELECT DATE(timestamp) AS ts,
YEAR(timestamp) AS year,
MONTH(timestamp) AS month,
DAY(timestamp) AS day,
SUM(paymentgross) AS sales
FROM stats_ans_1
GROUP BY DATE(timestamp) DESC
LIMIT 10
) AS TBL
GROUP BY ts");
这是时间戳:
2012-09-12 19:45:23
MONTH(timestamp) 绝对确定时间戳是在 10 月而不是 9 月 - 这显然是错误的。怜悯我可怜的脑细胞!