Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL claims that a built-in function "does not exist."

Tags:

mysql

Tell me what's wrong in these two queries?

SELECT * FROM `product_description` WHERE CHAR_LENGTH (description) > 250
SELECT * FROM `product_description` WHERE LENGTH (description) > 250

They return these error

Function table.name CHAR_LENGTH does not exist
Function table.name LENGTH does not exist

both functions seems not to work... what is going on ?

like image 869
Warface Avatar asked Nov 01 '25 10:11

Warface


1 Answers

Maybe it is this which causes the issue

By default there must be no whitespace between a function name and the parenthesis following it. This helps the MySQL parser distinguish between function calls and references to tables or columns that happen to have the same name as a function. However, spaces around function arguments are permitted.

like image 196
Luuk Avatar answered Nov 04 '25 00:11

Luuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!