LoginSignup
1
1

More than 5 years have passed since last update.

カラムの最大値? - MAX()関数の謎

Posted at

さて、何故でしょうか?

mysql> select hoge_id from gao;
+---------+
| hoge_id |
+---------+
| 1       |
| 2       |
| 3       |
| 4       |
| 5       |
| 6       |
| 7       |
| 7       |
| 9       |
| 10      |
| 11      |
| 12      |
| 13      |
| 1       |
| 15      |
| 16      |
| 17      |
| 18      |
| 19      |
| 20      |
| 21      |
| 22      |
| 23      |
| 24      |
| 25      |
| 26      |
| 27      |
| 28      |
| 29      |
| 30      |
| 31      |
| 32      |
| 33      |
| 34      |
| 35      |
| 36      |
| 10      |
+---------+
37 rows in set (0.00 sec)

mysql> select max(hoge_id) from gao;
+--------------+
| max(hoge_id) |
+--------------+
| 9            |
+--------------+
1 row in set (0.00 sec)
1
1
2

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
1
1