title: SQL Update Statement with a Case with Select Inside
body: <p>I want to run a mass update statement that selects the min and max of a column. The issue is that there are multiple columns with null values. If <code>NULL</code> then I want to set the <code>MinValue</code> to <code>0</code>. </p>
  
  <p>I have the following statement, but I am getting errors with the <code>SELECT</code> and <code>ELSE</code>:</p>
  
  <pre><code>UPDATE Table1 SET MaxValue = (
          SELECT MAX(column1) FROM Table2), 
          MinValue = (CASE 
              WHEN SELECT MIN(column1) FROM Table2 &lt;&gt; NULL 
              THEN SELECT MIN(column1) FROM Table2 
              ELSE '0' 
          END) 
  </code></pre>
  
  <p>What am I missing?</p>