Possible Duplicate:
Does COUNT(*) always return a result?
Is it possible in any scenario for the Count() function to return NULL?
COUNT does not include NULL values in column counts. Therefore, the number of return values for each column might differ or be less than the total number of rows returned by COUNT(*).
COUNT never returns null. The following example calculates, for each employee in the employees table, the moving count of employees earning salaries in the range 50 less than through 150 greater than the employee's salary.
The COUNT(*) function returns a number of rows in a specified table or view that includes the number of duplicates and NULL values.
As all of your values are null, count(cola) has to return zero.
No, it will only return a zero (or non-zero) result. SqlServer will not return null.
According to the MSDN page, no.
That said:
For return values greater than 2^31-1, COUNT produces an error. Use COUNT_BIG instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With