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.
- user_name
- [Optional] Name of user who owns table.
- 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;