
mysql> SELECT * FROM test;+----+----------+| id | username |
+----+----------+
| 1 | John |
| 2 | Mary |
| 3 | 1%Lily |
| 4 | Rose |
| 5 | NULL |
| 6 | Mary |
| 7 | Mary |
| 8 | H |
+----+----------+
mysql> SELECT AVG(id) FROM test; +---------+| AVG(id) |
+---------+
| 4.5000 |
+---------+
mysql> SELECT COUNT(id) AS counts FROM test;+--------+| counts |
+--------+
| 8 |
+--------+
mysql> SELECT MAX(id) AS counts FROM test;+--------+| counts |
+--------+
| 8 |
+--------+
mysql> SELECT MIN(id) AS counts FROM test;+--------+| counts |
+--------+
| 1 |
+--------+
mysql> SELECT SUM(id) AS counts FROM test;+--------+| counts |
+--------+
| 36 |
+--------+
一般不会对数据表中的id进行操作,这里只是...
