Archives of the TeradataForum
Message Posted: Wed, 09 Dec 2009 @ 16:59:07 GMT
Subj: | | Re: Populate columns with row number |
|
From: | | Rob Paller |
Row_Number() in Teradata is a window aggregate function. As such, you need to provide it a "window", so to speak.
UPDATE database.table
SET MyRowId = ROW_NUMBER() OVER (ORDER BY )
;
You could also partition by a set of fields as well if you want the Row_Number to restart after a group of fields values change:
UPDATE database.table
SET MyRowId = ROW_NUMBER() OVER (PARTITION BY ORDER BY
)
;
Hope this helps. There is more information available about using window aggregate functions in the Teradata Manuals.
|