Oracle Flashback – Using ‘As Of’ Clause with Table Aliases

flashbackoracle

I can run this flashback query with no problem:

select x from a as of timestamp sysdate;

But if I use a table alias I get an error.

select foo.x from a foo as of timestamp sysdate;
ORA-00933: SQL command not properly ended

How can I use "as of" with table aliases?

Best Answer

The table alias follows the "as of" clause.

select x from a as of timestamp sysdate foo;