MySQL COUNT() and nulls

后端 未结 5 982
庸人自扰
庸人自扰 2020-12-09 10:05

Am I correct in saying:

COUNT(expr)
WHERE expr IS NOT *  

Will count only non nulls?

Will COUN

5条回答
  •  庸人自扰
    2020-12-09 10:49

    count(*) is not for non-null columns, it's just the way to ask to count all rows. Roughly equivalent to count(1).

提交回复
热议问题