title: Add a mysql subquery to select data from yesterday
body: <p>I've a delivery system with the following mysql SELECT:</p>
  
  <pre><code>SELECT tb_pedido.*,tb_usuarios.nome,tb_usuarios.email,tb_usuarios.cpfcnpj, DATE_FORMAT(data_hora, '%Y-%m-%d') FROM tb_pedido,tb_usuarios where tb_pedido.id_usuario=tb_usuarios.id_usuario and (status=2 OR status=4) and DATE(data_hora) = CURDATE() order by id_pedido desc
  </code></pre>
  
  <p>It selects the orders form today with a specific status. What I want to do is to add a sub query to return all results from yesterday with status 8.</p>
  
  <p>I guess the following subquery would work but I don't know how to add it to the current query:</p>
  
  <pre><code>DATE_ADD(DATE(data_hora), INTERVAL -1 day) AND status=8
  </code></pre>
  
  <p>Anyone please?</p>