title: SQL Query in Apex if date not exist return value from previous date
body: <p>I need to generate interactive report in Oracle Apex by comparing 2 tables. Each table has Columns: Date, Tag, Number.</p>
  
  <p>Table 1: contains History of the changes of Column: Number and writes on which date the column: Number was changed.</p>
  
  <p>Table 2 : Also has column: Number and column: Date (column: Date which shows different values for column: Number for the different dates of the month).</p>
  
  <p>The Report is being generated when  comparing columns "Tag_id" between table 1 and table 2
  so we know which value from column: number in table 1 is referring to column: number in table 2. (...where table1.tag=table2.tag).</p>
  
  <p>Table 2 contains date in column: number for every day of the month, 
  and Table 1 contains date that is changed in column: number  once every 1,2,3 or more days.</p>
  
  <p>I want the report to show values from column: Number from Table 1 and to show the values from column: Number from Table 2 while making comparison between table 1 and table 2 by column: Date.</p>
  
  <p>The problem is when in Table 1 there is no date in column:Date which is equal to date in column:Date in Table 2, the Database doesnt know which value for column:Number to return in the Generated Report.</p>
  
  <p>What I want to achieve:
  When there is no date match in the columns:Date between Table 1 and Table 2 I want in the Generated report in Apex to return the value from column:Number from Table 2 for the 
  Date for which there is no match* and the value of column:Number from Table 1 for the closest previous date by using only SQL Query.</p>
  
  <p><a href="https://i.stack.imgur.com/6YeYM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6YeYM.png" alt="tables"></a></p>