mysql count的理解

mysql count的理解

1 select count(tel) as telcount from info;
如果tel列有null 将不会被统计进去

2 count(*) 这样写性能更好

3 MYISAM引擎 只有当没有where的时候 count(*) 查询才会达到神一样的速度!!
看下面例子就知道了
EXPLAIN SELECT count(id) FROM `grs_record_login`
row竟然没有值

原文地址:https://www.cnblogs.com/newmiracle/p/11875996.html