title: mysql IF EXISTS
body: <p>I have this table</p>
  
  <pre><code>UMS
  
  id_attribute    value   order
  1                MB      1
  1                Gb      2
  1                TB      3
  ...
  </code></pre>
  
  <p>and this table</p>
  
  <pre><code>ATTRIBUTE_VALUE
  id    id_attribute          value  name     ums
   1         1                 50     hdd     GB
   2         1                 100    hdd     TB
   3         2                 15.00  price   NULL
  </code></pre>
  
  <p>and i want to select from ATTRIBUTE_VALUE where id_attribute=1 and if exist (UMS.value=ATTRIBUTE_VALUE.ums) then order by UMS.order end if  group by ATTRIBUTE_VALUE.value</p>
  
  <p>example for output :</p>
  
  <pre><code>50 GB
  100 Tb
  
     and must to appear 
      15.00   !!! here is the problem because in my UMS table i don't have UMS for price
  
      but it doesn't appear
  </code></pre>