SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How To Use SELECT Statement to Count the Number of Rows?

Go down

How To Use SELECT Statement to Count the Number of Rows? Empty How To Use SELECT Statement to Count the Number of Rows?

Post by Micheal Sun Jan 17, 2010 3:03 am

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.

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum