LoginSignup
4
2

More than 5 years have passed since last update.

MySQL でカウントを取ろうとしたらエラー

Last updated at Posted at 2017-02-20

COUNT キーワードのあとにスペースを入れてはいけない。ってのが結論なのですが、恥ずかしながら今日まで知らなかったのでメモ。

SELECT クエリでカウントを取るとき、 COUNT に続けてスペースを入れてはいけません。
スペースを入れずに ( を続けるのが正しい構文のようです。
違反すると、以下のようなエラーが出ます。

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

参考: http://stackoverflow.com/questions/7840253/sql-count-not-working

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2