On this page

CNT

Core command

Counts the rows of a table, as SELECT COUNT(*) FROM the table would.

Syntax

CNT [<schema>.]<table>

Arguments

ArgumentRequiredValuesDefault
<table>YesA table name, in double quotes when it contains spaces or special charactersNone
<schema>.NoThe schema of the table, followed by a dotThe current schema

Examples

CNT CUSTOMER;
CNT PUBLIC.CUSTOMER;
CNT "Sales Data";

Details

A name containing spaces or other special characters is written in double quotes (CNT "Sales Data"). The table is found exactly as ALL finds it: the name as typed, then in upper case, then in lower case. The count runs on that table, its name quoted for the connected database. A plain name that no lookup finds is sent to the database as typed; otherwise the command reports that the table does not exist.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.