Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

SQL Error #1064 Syntax.

Lakshmi.'s profile image Lakshmi. posted 4 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 4 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.