お世話になっております。
以下のとおりのデータベースがあります。
MariaDB [(none)]> show tables from kensa_db;
+--------------------+
| Tables_in_kensa_db |
+--------------------+
| table_kenoi |
| table_shokuin |
+--------------------+
2 rows in set (0.00 sec)
OSはcentos7です。
データベースはServer version: 5.5.56-MariaDB MariaDB Serverです。
テーブル「table_kenoi」の行数を数えたく以下のように複数のパターンで
試しましたがエラーとなります。ご教示お願いいたします。
sql
1SELECT * COUNT(id) FROM table_kenoi; 2ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 3corresponds to your MariaDB server version for the right syntax to use near 'COU 4NT(id) FROM table_kenoi' at line 1 5 6SELECT COUNT(id) FROM table_kenoi; 7ERROR 1046 (3D000): No database selected 8 9SELECT id COUNT(id) FROM table_kenoi; 10ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 11corresponds to your MariaDB server version for the right syntax to use near 'COU 12NT(id) FROM table_kenoi' at line 1 13 14SELECT id COUNT( * ) FROM table_kenoi; 15ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 16corresponds to your MariaDB server version for the right syntax to use near 'COU 17NT( * ) FROM table_kenoi' at line 1 18 19SELECT * COUNT(*) FROM table_kenoi; 20ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 21corresponds to your MariaDB server version for the right syntax to use near 'COU 22NT(*) FROM table_kenoi' at line 1
回答2件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2018/08/18 03:03
2018/08/18 03:05