ROWNUM
Purpose
ROWNUM is a pseudo column that is assigned an incremental unique integer value for records of a table or subselects, beginning with 1.
Usage notes
Exasol implements ROWNUM adhering to the overall SQL semantics.
ROWNUMcannot be combined with other conditions in theWHEREclause. Anything you put into theWHEREclause of a statement filters input data. To avoid confusion and seemingly wrong results, we only allowROWNUMin situations where the result is in line with Oracle's semantic.ROWNUMcannot be used in combination with the PRIMARY KEY, UNIQUE, and FOREIGN KEY statements.-
ROWNUM(in uppercase) is a reserved column name, which means that columns in tables orSELECTstatements cannot be namedROWNUM, even when delimited with quotes as"ROWNUM". However, any variation in case will allow the name to be used. For example, the delimited name"rownum"is accepted, even if the system valueSQL_IDENTIFIER_COMPARISONis set toIGNORE CASE.
Examples:
SELECT SALES_ID, ROWNUM
FROM SALES
WHERE ROWNUM <10;
| SALES_ID | ROWNUM |
| 389577429 | 1 |
| 321740964 | 2 |
| 389577438 | 3 |
| 253762032 | 4 |
| 321740973 | 5 |
| 389577447 | 6 |
| 458941123 | 7 |
| 389577513 | 8 |
| 389577522 | 9 |