SQL Error #1064 Syntax.

[expired user #10084]'s profile image [expired user #10084] posted 8 years ago in Running SQL scripts Permalink

I cannot figure out what is wrong with the syntax in the```



SELECT user_id, 
( SUM( IF( the_day ='2016-08-24', ct, 0 ))) AS 2016-08-24, 
( SUM( IF( the_day ='2016-08-25', ct, 0 ))) AS 2016-08-25, 
( SUM( IF( the_day ='2016-08-26', ct, 0 ))) AS 2016-08-26, 
( SUM( IF( the_day ='2016-08-27', ct, 0 ))) AS 2016-08-27, 

FROM ( select user_id, DATE(date_time) AS the_day, loggedin_user, COUNT(*) AS ct FROM applications GROUP BY 1,2 ) AS x 
GROUP BY user_id;

All help is appreciated. Thank you. 
kalvaro's profile image kalvaro posted 8 years ago Permalink

Please read the error message again: this is a parse error generated by MySQL Server and HeidiSQL does not strip information from such errors.

Please login to leave a reply, or register at first.