title: Oracle SQL Update on Inner Join
body: <p>Stuck on something I a bit simpler this morning. </p>
  
  <p>I have the following issue with readings and Daylight savings times going a bit mad. </p>
  
  <p>I need to set OLD = NEW in the following. </p>
  
  <pre><code>select d.t0100 as tab1,
         t.t2400 as tab2
      from reportro.non_dst_readings d
          inner join reportro.dst_readings t
              on d.cust = t.cust
              and to_date(d.readdate_ndst, 'dd-mmm-yy') 
                   = (to_date(t.readdate, 'dd-mmm-yy') -1);
  </code></pre>
  
  <p>^^ But the above select isn't working, much less the update. </p>
  
  <p>I was going to try to update them by:</p>
  
  <pre><code>update (
  select d.t0100 as tab1,
         t.t2400 as tab2
      from report.non_dst_readings d
          inner join report.dst_readings t
              on d.cust = t.cust
              on to_date(d.readdate_ndst, 'dd-mmm-yy') 
                   = (to_date(t.readdate, 'dd-mmm-yy') -1)
          )
   set old = new;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks again, I'd be so lost without StackOverflow :)</p>