title: MySQL Left Join with WHERE and Greater than
body: <p>I want to do a <code>LEFT JOIN</code> and then sort my display by a <code>rank</code> column and also show items only if the <code>qty</code> column is greater than 0</p>
  
  <pre><code>SELECT 
  *
  FROM `product`
  LEFT JOIN `stock`
  ON `product`.`product_id`=`stock`.`pid`
  AND `qty` &gt; 1
  ORDER BY `product`.`rank` ASC
  </code></pre>
  
  <p><strong>Product Table</strong></p>
  
  <pre><code>product_id
  name
  rank
  price
  </code></pre>
  
  <p><strong>Stock Table</strong></p>
  
  <pre><code>pid
  price_sale
  qty
  
  Product Table
  
  12, Pen, 2, 53.00
  13, Pen, 1, 58.00
  14, Pen, 3, 25.00
  
  Stock Table
  
  12, 10.00, 5 
  13, 18.00, 15
  </code></pre>
  
  <p>My results do not appear.</p>
  
  <p>It should display:</p>
  
  <pre><code>12, Pen, 2, 53.00, 12, 10.00, 5
  13, Pen, 1, 58.00, 13, 18.00, 15
  </code></pre>