count(*) 与 count(name) 区别

select count(*) from project   返回表所有行总数

select count(name) from project    返回表所有行中name不为null的行总数

 

如果name确保不为null,上面两条查询语句的结果是一样的

 

所以

select count(name) from project where name is null

是无效的

posted @ 2012-03-17 10:05  Yu  阅读(276)  评论(0编辑  收藏  举报