Saturday, March 13, 2021

SELECT COUNT(*) + COUNT(*)

 - COUNT always returns an int data type value.

 - COUNT(*) returns the number of items in a group. This includes NULL values and duplicates.

Thus, since you didn't provide a table to do a COUNT from, the default (assumption) is that it returns a 1.

So, the output of  SELECT COUNT(*) + COUNT(*) is 2.



No comments:

Post a Comment