Answers
没有区别.
mysql> explain extended select count(*) from tmp;
...
1 row in set, 1 warning (0.34 sec)
mysql> show warnings;
+-------+------+--------------------------------------------------+
| Level | Code | Message |
+-------+------+--------------------------------------------------+
| Note | 1003 | select count(0) AS `count(*)` from `test1`.`tmp` |
+-------+------+--------------------------------------------------+
1 row in set (0.00 sec)
http://dev.mysql.com/doc/refman/5.6/en/group-by-functions.html#function_count
COUNT(expr) Returns a count of the number of non-NULL values of expr in
the rows retrieved by a SELECT statement. ... COUNT(*) is somewhat different
in that it returns a count of the number of rows retrieved, whether or
not they contain NULL values.
消逝的热情
answered 10 years, 1 month ago