The general method for creating a snapshot 'view' for a specified SnapshotTime is as follows:
- Exclude all versions with an effectiveTime greater than the SnapshotTime.
Note: In theory the most recent
step could be omitted. However, a release will often be distributed before its effectiveTime
. Therefore, this approach is not recommended as a general approach in a live system.
- From each set of versions with the same id select the version with the highest (most recent) effectiveTime .
In this sample code `snapshotTime()` is a function that returns the time to be applied to this snapshot. For the most recent
this can be omitted as shown below:
Similar views can be created for each of the
tables by simply replacing the table name in both the outer and nested queries.
Note: The SQL queries in this and the following section assume applicability of a common versioning view for all
. In some case, where a
that is being used depends on an earlier version of another
, more complex queries and optimizations may be needed. For further information about how dependencies between
are represented see details of the Module dependency reference set