title: SQL case-when-else statement efficiency
body: <p>When I use this statement;</p>
  
  <pre><code>UPDATE TABLE
     SET FIELD = CASE
                 WHEN NAME = 'a' THEN (SELECT NO FROM TABLE_TWO WHERE NAME = 'a')
                 ELSE 'x' END
   WHERE FIELD_TWO = 1
  </code></pre>
  
  <p>if <code>TABLE.NAME != 'a'</code> will the select SQL executed nevertheless?
  Moreover, a little extra question, do you think it is proper to have such logic in SQL code for any given product? I think having any logic in SQL makes its coverage very difficult, and hard to maintain, what do you think?</p>
  
  <p>edit: select statement only returns a single value, ignore the case where it can return multiple values, that case is not in  the scope of this question.</p>