TD_FillRowID Example | FillRowID | Teradata Vantage - Example: Using TD_FillRowID to Generate Row Identifiers - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798

Every complete example in this document is available in a zip file that you can download. The zip file includes a SQL script file that creates the input tables for the examples. If you are reading this document on https://docs.teradata.com/, you can download the zip file (SQLE-Analytic-Functions-Examples_xxxx) from the attachment in the left pane.

TD_FillRowID InputTable: fillrowid_input

 Survived Pclass Name               Age 
 -------- ------ ------------------ --- 
        0      3 Mrs. Jacques Heath  35
        0      3 Mr. Owen Harris     22
        1      3 Mrs. Laina          26
        1      1 Mrs. John Bradley   38

TD_FillRowID SQL Call

SELECT * FROM TD_FillRowID (
  ON fillrowid_input AS InputTable
  PARTITION BY Pclass
  ORDER BY Age
  USING
  RowIDColumnName ('PassengerId')
) AS dt;

TD_FillRowID Output

The output shows the generated IDs in the PassengerId column.

Survived  Pclass   Name            Age  PassengerId 
   -------- ------ ------------------ ---  ----------- 
        1      1   Mrs. John Bradley   38           4
        0      3   Mr. Owen Harris     22           4
        1      3   Mrs. Laina          26           8
        0      3   Mrs. Jacques Heath  35          12