The COUNT()
function returns the number of rows that matches a specified criterion.
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
SELECT COUNT(DISTINCT Price)
FROM Products;
Give the counted column a name by using the AS
keyword.
SELECT COUNT(*) AS [number of records]
FROM Products;