title: Merge update Temporal
body: <p>Existing data in table test : (Temporal table)</p>
  
  <pre><code>id name    valid_dt
  1  cat     2012-06-16 - 9999-12-31
  </code></pre>
  
  <p>Incoming Table : (Temporal)</p>
  
  <pre><code>  id name  valid_dt
    1  bat   2013-12-28 - 9999-12-31
  </code></pre>
  
  <p>After Merge update , test table should have </p>
  
  <pre><code>id name valid_dt
  1 cat    2012-06-16 - 2013-12-28
  1 bat    2013-12-28 - 9999-12-31
  </code></pre>
  
  <p>Will It be possible in Teradata Temporal Merge update statement if i run it today?</p>
  
  <p>non working code i tried</p>
  
  <pre><code>SEQUENCED VALIDTIME 
  MERGE INTO  test
  USING    
  (  
    sel * from incoming 
  ) H on id=H.id
  when matched then
  update  
  set name = h.name
  ;
  </code></pre>
  
  <p>UPDATE After trying dnoeths solution:
  For delete :</p>
  
  <p>In my real incoming table some records were actually closed .</p>
  
  <p>so i need hard code end date as until_changed</p>
  
  <p>non working delete :</p>
  
  <pre><code>sequenced validtime
  delete from test where (cust_id,name) in
  (nonsequenced validtime
   select id,name,period(begin(valid_dt),until_changed)
  from incoming );
  </code></pre>