title: Set a variable inside case statement in mysql
body: <p>I have the following scenario</p>
  
  <pre><code>SELECT
  ...
  ...
  (
     @var1 = MAX(IF(table1.name='Mod', table1.value, NULL))
     @var2 = MAX(IF(table1.name='Man', table1.value, NULL))
       CASE
          WHEN @var1 IS NOT NULL &amp;&amp; @var2 IS NOT NULL THEN @var1+"/"+@var2
          WHEN @var1 IS NULL &amp;&amp; @var2 IS NOT NULL THEN @var2
          WHEN @var1 IS NOT NULL &amp;&amp; @var2 IS NULL THEN @var1
          ELSE NULL
  END) AS "col44",
  </code></pre>
  
  <p>This is throwing me an exception in the mysql console. </p>
  
  <p>Can't we do a variable assignment in the general mysql select query? </p>