Counting rows in a table

You can count the number of rows in a table using the select keyword.

Syntax

The following syntax shows how to use the select keyword to count the number of rows in a table.

select                   count(*)
from                     database_name.table_name
[ where                  conditional_test ]

Example 1

The following example shows how to use the select statement within the OQL Service Provider to count the number of rows in the staff.managers table.

|phoenix:1.> select count(*) from staff.managers;
|phoenix:2.> go
.....
{
        Count=5;
}
( 1 record(s) : Transaction complete )