SQL Error #1064 Syntax.

Lakshmi. posted 3 years ago in Running SQL scripts

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 posted 3 years ago

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.