FLASHBACK QUERY
FLASHBACK QUERY is a SQL statement in the Oracle Specific category. Oracle: query data as it existed at a previous point in time (using undo data). The syntax is SELECT * FROM table AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '15' MINUTE);. It returns historical data. A typical example: SELECT * FROM employees AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '30' MINUTE); -- Employee data as it was 30 minutes ago SELECT * FROM employees VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE; -- Shows all versions of rows between SCNs -- Flashback is possible within the UNDO retention period A close relative is SEQUENCE (Oracle), which oracle: generates sequential numbers. Independent of tables. Accessed via NEXTVAL and CURRVAL. A close relative is ROWNUM / FETCH FIRST, which oracle: ROWNUM assigns sequential numbers to rows. Used for limiting results (pre-12c). A close relative is SYSDATE / CURRENT_DATE, which oracle: returns the current date and time of the database server.