我在下面的"信息"表中有4列:'creator_id','viewer_id','date_format','donation'
CREATE TABLE information (
creator_id INT NOT NULL,
viewer_id INT NOT NULL,
date_format DATE NOT NULL,
donation INT NOT NULL
);
INSERT
INTO twitch.information(creator_id,viewer_id,date_format,donation)
VALUES
(10,11,'2014-01-02',34),
(20,14,'2014-01-02',150),
(30,15,'2014-01-02',717),
(31,17,'2014-01-02',177),
(32,17,'2014-01-06',737),
(33,16,'2014-01-07',37),
(40,18,'2016-03-08',442),
(41,19,'2016-03-09',142),
(42,10,'2016-03-10',152),
(43,11,'2016-03-11',512),
(44,12,'2016-01-12',340),
(60,0,'2012-01-02',1000),
(70,1,'2012-01-02',100);
SELECT creator_id,
MAX(SUM(donation)/COUNT(donation)) AS "TOP AVG DONATION CREATOR ON YEAR 2014 (January)"
WHERE date_format = "2014-01-02"
FROM twitch.information;
我正在查找在"2014-01-02"日期平均捐赠金额最高的creator\u id,但我的输出控制台出现了以下错误:Error code 1064: you have error in your SQL Syntax; check the manual corresponding...
我相信我的语法有问题,但我不知道是什么.