Possible Duplicate:
Does COUNT(*) always return a result?
Is it possible in any scenario for the Count() function to return NULL?
Possible Duplicate:
Does COUNT(*) always return a result?
Is it possible in any scenario for the Count() function to return NULL?
No, it will only return a zero (or non-zero) result. SqlServer will not return null.
GROUP BY
and there is no group). Depending on how you use your query, for instance if you use some ORM, this no result might be mapped to a null
. –
Leix According to the MSDN page, no.
That said:
For return values greater than 2^31-1, COUNT produces an error. Use COUNT_BIG instead.
No.
This will be 0
select count(*)
where 0=1
This will be 1
select count(*)
No it returns a zero if the table does not have any records in the table
No. If the table or specific field being counted are empty it will return zero.
© 2022 - 2024 — McMap. All rights reserved.