当我在工作台中运行它时,这个MySQL看起来很好,但在运行phpmyadmin时会抛出错误。
SELECT
round(AVG(compoundScore),3) as 'Sentiment Score',
count(*) as 'Tweets',
(DATE_ADD(DATE_FORMAT(FROM_UNIXTIME(time), "%Y-%m-%d %H:00:00"),
INTERVAL (case when MINUTE(FROM_UNIXTIME(time)) < 30 then 0 else 1 end) HOUR)) AS the_rounded_date
FROM rawTweets
WHERE
date = CURDATE()
AND LOCATE('trump', cleanTweet)
AND compoundScore IS NOT NULL
AND compoundScore != 0.0
GROUP BY the_rounded_date
MySQL said: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; 30 then 0 else 1 end) HOUR)) AS the_rounded_date FROM rawTweets WHERE date = C' at line 1.