title: Given value in history of time
body: <p>I am looking for a way to query data from Oracle.
  The idea would be to return values in a given time frame (let's say 2021-01-01 &amp; 2021-12-31).
  We have a table that stores all changes historically.</p>
  <p><a href="https://i.stack.imgur.com/Q58ux.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q58ux.png" alt="enter image description here" /></a></p>
  <p>I am only concerned with up to colum 3 (Org Type) and do not care about what changed beside that column.</p>
  <p>In essence, I would like to be able to answer:
  What was Org# 8124's Org Type on 2021.01.04. (in which case it would be the latest since it has changed on that day)
  Additionally, I since this table only tracks changes, it would need to extend to dates not captured here.
  Meaning, for example Org# 18612 has last changed on 2021.01.10. so if someone asks, what was its value on 2021.07.07.(which is not captured in the table) it should be the latest.</p>
  <p>I managed to get before&amp;after values with LAG, but I am not sure how to work this out, as again, I need to populate everyday with a value (even tho I don't have that date in the table)
  Not sure if it makes any sense. Any help is appreciated.</p>