How To Use SELECT Statement to Count the Number of Rows

Q

How To Use SELECT Statement to Count the Number of Rows? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements

✍: FYIcenter.com

A

If you want to count the number of rows, you can use the COUNT(*) function in the SELECT clause. The following select statement returns the number of rows in the "department" table:

SQL> SELECT COUNT(*) FROM departments;
  COUNT(*)
----------
        27

So there are 27 rows in the "departments" table.

2007-04-20, 6905👍, 0💬