Bug #112284 COUNT function causing error code: 1064
Submitted: 7 Sep 2023 7:58 Modified: 7 Sep 2023 12:04
Reporter: Llew Jones Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.34 OS:MacOS
Assigned to: CPU Architecture:x86
Tags: count

[7 Sep 2023 7:58] Llew Jones
Description:
Hi, I am having issues with the COUNT function.

See below my script.

SELECT rating
	COUNT (film_id)
FROM film
GROUP BY 
	rating

Error Code: 1064. 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 '(film_id) FROM film GROUP BY   rating' at line 2

How to repeat:
Hi, I am having issues with the COUNT function.

See below my script.

SELECT rating
	COUNT (film_id)
FROM film
GROUP BY 
	rating

Error Code: 1064. 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 '(film_id) FROM film GROUP BY   rating' at line 2
[7 Sep 2023 8:44] Llew Jones
PLEASE IGNORE
[7 Sep 2023 12:04] MySQL Verification Team
Hello!

Thank you for the bug report.
Imho this is not a bug. Please remove extra spaces near COUNT().
Also, add comma after each column select. Please double-check the documentation available at https://dev.mysql.com/doc/refman/8.0/en/select.html 

SELECT rating,
	COUNT(film_id)
FROM film
GROUP BY rating;

Regards,
Ashwini Patil