title: SQL query to retrive data from database
body: <p>I retrieve items from database based on their location id and quantity more than five items but i want for specific location id retrieve items with quantity more than 0 items </p>
  
  <p>This is my query:</p>
  
  <pre><code>SELECT DISTINCT(warehouses.item_id), SUM(warehouses.qty) AS qty, items.gender_id, items_dept.desc, items_dept.dept_id, items.msrp,items.rtp
  FROM `warehouses`
      JOIN `items`
          ON items.item_id = warehouses.item_id
      JOIN `items_dept`
          ON items_dept.dept_id = items.dept_id
  WHERE items.gender_id IN (3,5,6)
  AND qty &gt; 5
  AND warehouses.wrhs_id IN (20,21,22,23,24,25,26,27,28,29,30,31,32,38,40,44,47,49,55,60,61)
  AND items.dept_id = :catId
  AND items.rtp BETWEEN :priceX AND :priceY
  GROUP BY warehouses.item_id
  ORDER BY warehouses.item_id ASC
  </code></pre>
  
  <p>I want for wrhs_id (44) the quantity not more than 5 but more than 0</p>