The COUNT() function returns the number of rows in the specified table. There are two ways you can use COUNT(), which are the following:
- COUNT(*) count all the rows in the table including
- COUNT(column) return all the rows that contains value for the column, excluding the columns with null value
SELECT COUNT(*) AS NumberOfRows
FROM Customers
The query above returns the number of rows in the Customers table

SELECT COUNT(Region) AS NumberOfRows
FROM Customers
The query above counts the number of rows for the column "Region" that are not NULL
No comments:
Post a Comment