title: TSQL Update value to 1 if Max value between two table else 0
body: <p>I have two table </p>
  
  <pre><code>TABLE 1 : Stage_product
  PRODUCT_ID      SYS_ROWDATETIMEUTC  
  1                2015-03-13 06:09:30.040
  2                ....
  3
  
  
  TABLE 2 : DIM_Product
  PRODUCT_ID      SYS_ROWSTARTDATETIMEUTC       SYS_ROWISCURRENT
  1               2014-03-13 06:09:30.040            0
  2               2015-03-13 06:09:30.040            1
  </code></pre>
  
  <p>I want to do an update statement that if the value <code>SYS_ROWDATETIMEUTC</code> in the first table is more recent than the value <code>SYS_ROWSTARTDATETIMEUTC</code> in the table, then the value <code>SYS_ROWISCURRENT</code> in the second table is set to 0, else 1. </p>