Mysql:"select" is not valid at this position for this server verision,expecting:"(",with

今天两段看起来一样的代码,却一个报错,一个不报错。

Mysql:"select" is not valid at this position for this server verision,expecting:"(",with报错提示:Mysql:"select" is not valid at this position for this server verision,expecting:"(",with

原因:count 与 (*) 中间有空格会导致语法出错。

解决方案:尝试删除“ COUNT”和方括号之间的空格。如下图。就没有错误提示了。

Mysql:"select" is not valid at this position for this server verision,expecting:"(",with另外:MySQL中使用函数时,与后面括号不能之间不能加空格。