SELECT AS OF VERSION Statement | VantageCloud Lake - SELECT ... AS OF version_number - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

SELECT ... AS OF version_number selects the rows of an Object File System table that existed in a specified version.

Syntax

SELECT select_list FROM [{ database_name | user_name }.]table_name AS OF version_number [;]

Syntax Elements

select_list
Specifies data to select from table. See Select List Syntax.
database_name
[Optional] Name of database containing table.
Default: Current database
user_name
[Optional] Name of user who owns table.
Default: Current user
table_name
Name of Object File System or temporal table from which to select data.
version_number
Number of the version from which to select data, a nonnegative integer.

Example: Using SELECT ... AS OF version_number to Undo a Change

Assume you made this change in version 2:

UPDATE EmployeeTbl SET Salary = Salary * 1.25;

The following statement undoes the change:

DELETE EmployeeTbl;

INSERT EmployeeTbl
  SELECT * FROM EmployeeTbl AS OF 2;