title: MySQL Nested WHERE - OR
body: <p>I will need a little help here </p>
  
  <p>Problem is - after WHERE clause I only need rows where CBI is Critical or HIGH or there is combination where CBI is Medium and Priority is 1. </p>
  
  <p>Unfortunately I am still getting rows where e.g. CBI is medium and priority is 2</p>
  
  <pre><code>SELECT * FROM main_table WHERE (cbi='Critical' OR cbi='High' OR (cbi='Medium' AND priority='1')) 
       AND start_date BETWEEN (NOW() - INTERVAL 12 HOUR) AND NOW() 
        OR involvement_date BETWEEN (NOW() - INTERVAL 12 HOUR) AND NOW() 
        OR finnish_date BETWEEN (NOW() - INTERVAL 12 HOUR) AND NOW();
  </code></pre>