How to count NULL values in MySQL?

前端 未结 7 1183
猫巷女王i
猫巷女王i 2021-02-04 03:56

I want to know how can i find all the values that are NULL in the MySQL database for example I\'m trying to display all the users who don\'t have an average yet.

Here i

7条回答
  •  名媛妹妹
    2021-02-04 04:45

    you're on the right track. Remove '_' from 'IS_NULL' and change 'COUNT(average)' to 'COUNT(1)' and you will have it.

    For more information on working with NULL in MYSQL see http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html

    And for working with IS NULL specifically see

    http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_is-null

提交回复
热议问题