Oracle record history using as of timestamp within a range

前端 未结 3 999
小鲜肉
小鲜肉 2021-01-06 12:19

I recently learnt that oracle has a feature which was pretty useful to me - as the designer/implementator didn\'t care much about data history - I can query the historical s

3条回答
  •  爱一瞬间的悲伤
    2021-01-06 12:48

    SELECT *
      FROM sometable
      VERSIONS BETWEEN TIMESTAMP systimestamp - 1 AND systimestamp
    

    will give you all versions of all rows in the last day.

    There's lots more you can do with this. Check out the documentation (you may want to find the docs for your version).

提交回复
热议问题