title: How to use IN operator with AND operator in WHERE clause in SQL...?
body: <p>I am using this database query in my CodeIgniter model.</p>
  
  <pre><code>SELECT
                  p.product_id,
                  p.product_name,
                  p.product_photo,
                  p.size,
                  p.price,
                  p.status,
                  p.product_image_path
              FROM
                  products AS p
              LEFT JOIN
                  product_category AS pc
              ON
                  p.product_id = pc.product_id
              LEFT JOIN
                  vendor_products AS vp
              ON
                  vp.product_id = pc.product_id
              WHERE
                  pc.category_id = 2
              AND
                  vp.vendor_id = 36
              AND 
                  pc.subcategory_id IN (1,2)
              AND
                  pc.subcategory_value_id IN (1,4)
  </code></pre>
  
  <p>And it returning me:</p>
  
  <p><img src="https://i.stack.imgur.com/pDlhF.png" alt="It is returning duplicate entries"></p>
  
  <p>I want those products only who fills all conditions of sub_category_value_id. Now it is returning all the conditions.</p>
  
  <p>I am new to database and don't know much about queries.</p>