Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Versions Between and As OF clause - from which perspective?

2776946Sep 12 2015 — edited Sep 13 2015

From my text. Steve O'hearn Ora-1z0-047 textbook. Chapter 15 last couple of pages

You can combine the AS OF clause and the VERSIONS BETWEEN clause in a  single SELECT statement.


For example:

SELECT CHAT_ID, VERSIONS_STARTSCN, VERSIONS_ENDSCN, VERSIONS_OPERATION

FROM CHAT

VERSIONS BETWEEN TIMESTAMP MINVALUE

AND MAXVALUE

AS OF TIMESTAMP SYSTIMESTAMP - INTERVAL '0 00:15:00' DAY TO SECOND

ORDER BY CHAT_ID, VERSIONS_OPERATION DESC;

Note that the VERSIONS BETWEEN clause precedes the AS OF clause; this

is required. When combined, the VERSIONS BETWEEN values are determined

AS OF the time specified by the AS OF clause.;;;

so from the above query is the versions between being operated on min and max values from the prespective of the AS OF clause --

in other worths in this case the highest possible maxvalue can be is 15 minutes ago?

SELECT CHAT_ID, VERSIONS_STARTSCN, VERSIONS_ENDSCN, VERSIONS_OPERATION

FROM CHAT

VERSIONS BETWEEN TIMESTAMP MINVALUE

AND MAXVALUE

AS OF TIMESTAMP SYSTIMESTAMP - INTERVAL '0 00:15:00' DAY TO SECOND

ORDER BY CHAT_ID, VERSIONS_OPERATION DESC;

yes I have been playing with version flashbacks all night and I will try it myself. Just wouldn't hurt to have some advice.

Thanks much.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2015
Added on Sep 12 2015
1 comment
996 views