Difference between revisions of "ROWNUM()"

From Recital Documentation Wiki
Jump to: navigation, search
(Products)
m (ROWNUM moved to ROWNUM())
(No difference)

Revision as of 15:03, 4 July 2011

Purpose

Return a number indicating the order in which the rows are selected from the table


Syntax

ROWNUM


See Also

PSEUDO COLUMNS, INSERT, SELECT, UPDATE


Description

A Pseudo Column behaves like a table column, but is not actually stored in the table. You can select from Pseudo Columns, but they cannot be updated. Pseudo Columns provide extra information about a SELECT row set.

The ROWNUM Pseudo Column will return a number indicating the order in which the rows are selected from the table.


Example

// Display all overdue accounts with 15% commission in
// Sorted "name" and "paid date" order with the row number.
EXEC SQL
SELECT ROWNUM, name, address, balance, cost*1.15
FROM accounts
WHERE paid_date < date()
ORDER BY name, paid_date;


Products

Recital, Recital Server