999999 555-1234 1/1/01 999999 555-3456 4/21/02 999999 555-7890 9/18/04 999998 555-9998 4/20/05 999998 555-9998 5/20/06 I'd like the output to give me only the most recently inserted record, so, the highest LastUpdated date for each ID: 999998 555-9998 5/20/06
In Sql, using rowid and rownum function we can achieve the result. But how can we get it in teradata since we can not use those 2 function in teradata 12 version.
You can get the latest record using an identity column. If u have identity column like timestamp then u can get the latest record as max(timestamp) group by PI values. If you don't have any thing like timestamp then append one more column in the table definition as an identity column and you can use that to get the latest record.( I don't think this will effect the performance)