title: Mysql Compare two columns
body: <p>I've a database table with the following columns:<br>id_product, qty, total</p>
  
  <p>I want to select all products where qty &lt; total.<br>
  This is what I'm using right now but it doesn't work:</p>
  
  <pre><code>SELECT * FROM tb_products WHERE id_product='$id' AND qty &lt; total;
  </code></pre>