An analyst needs to query a historical snapshot of a table named INVENTORY exactly as it existed at transaction ID 8675309. Which SQL syntax is correct?
- A. SELECT * FROM INVENTORY AT (STATEMENT => '8675309') BEFORE CURRENT;
- B. SELECT * FROM INVENTORY AT (STATEMENT => '8675309');
- C. SELECT * FROM INVENTORY AT (VERSION => 8675309);✓ Correct
- D. SELECT * FROM INVENTORY BEFORE (TRANSACTION => 8675309);
Explanation
Time Travel using a specific transaction ID uses the VERSION keyword: AT (VERSION => <integer>). This retrieves the table state as of that specific transaction. STATEMENT => accepts a query ID (string UUID), not a transaction integer ID—it returns the table state just after that statement executed, not at a transaction boundary. BEFORE (TRANSACTION => ...) is not valid Snowflake Time Travel syntax. AT (...) BEFORE CURRENT is not valid syntax at all. VERSION => is the correct parameter for transaction-based Time Travel.