23 January 2014

SELECT command with COUNT () function

Count () aggregate function returns number of rows either specified any column name or whole table.

Syntax:

SELECT COUNT ([SPECIFIED_COLUMN_NAME] | [ALL]) FROM <TABLE_NAME>

Example:

--- COUNT THE NUMBER OF ROWS IN STUDENT_MARKS TABLE
SELECT COUNT(*) FROM STUDENT_MARKS

No comments:

Post a Comment