ROWNUM
Translation spec for ROWNUM pseudocolumn
Description
For each row returned by a query, the
ROWNUMpseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. (Oracle SQL Language Reference Rownum pseudocolumn)
Snowflake does not have an equivalent for ROWNUM. The approach for the transformation is taking advantage of the Snowflake seq8 function to emulate the functionality.
ROWNUMSample Source Patterns
Oracle
-- Table with sample data
CREATE TABLE TABLE1(COL1 VARCHAR(20), COL2 NUMBER);
INSERT INTO TABLE1 (COL1, COL2) VALUES('ROWNUM: ', null);
INSERT INTO TABLE1 (COL1, COL2) VALUES('ROWNUM: ', null);
-- Query 1: ROWNUM in a select
SELECT ROWNUM FROM TABLE1;
-- Query 2: ROWNUM in DML
UPDATE TABLE1 SET COL2 = ROWNUM;
SELECT * FROM TABLE1;|ROWNUM|
|------|
|1 |
|2 |
|COL1 |COL2|
|--------|----|
|ROWNUM: |1 |
|ROWNUM: |2 |
Snowflake
Known Issues
No issues were found.
Related EWIs
No related EWIs.
Last updated
Was this helpful?