Counting Rows
Use Case #1: Count the number of rows in a table
SELECT COUNT(*) FROM table_name;SELECT COUNT(col_name) FROM table_name;Use Case #2: Counting the number of records that match a condition
SELECT COUNT(*) FROM table_name WHERE condition;Use Case #3: Counting the distinct values that populates an attribute
SELECT COUNT(DISTINCT column_name) FROM table_name;Last updated