Find number of rows in a table in sql

How to find number of row in a table using sql statement

Posted by Luke Beeno on August 31, 2022

Find number of rows in a table in sql

How to find number of row in a table using sql statement

Posted by Luke Beeno on August 31, 2022

Here is how you can find the number of rows in a table.

Option 1. Find number of rows based on column value

SELECT count(*) FROM TableName where ColumnName = 'Guest';

Option 2. Use column name to count rows

SELECT count(ColumnName) FROM TableName;

Option 3. Use column name to count rows and specify column value

SELECT count(ColumnName) FROM TableName where ColumnName = 'Guest';