Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SELECT COUNT query throws error in MySQL

Tags:

mysql

I have a database named webshop on localhost with several tables in it. When I run the query: SELECT COUNT (userId) FROM users;

It trows me the following error:

FUNCTION webshop.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual

I have no idea why, as the query seems fine to me, does anyone?

like image 567
codeDragon Avatar asked Dec 23 '22 12:12

codeDragon


1 Answers

Remove the space before the opening parenthesis

SELECT COUNT(userId) FROM users;

See Function Name Parsing and Resolution (which, incidentally, is exactly what the error told you to do!)

like image 54
Paul Dixon Avatar answered Jan 05 '23 14:01

Paul Dixon