Tuesday, July 5, 2011

SQL COUNT() function (*) includes null, rest do not

COUNT(*) returns the number of items in a group. This includes NULL values and duplicates.
COUNT(ALL expression) evaluates expression for each row in a group and returns the number of nonnull values.
COUNT(DISTINCT expression) evaluates expression for each row in a group and returns the number of unique, nonnull values.
For return values greater than 2^31-1, COUNT produces an error. Use COUNT_BIG instead.

No comments:

Post a Comment

React : Event handlers with parameters in functional components

 Read with  this post In React, you cannot directly pass a parameter to a handler like because this executes the function immediately durin...