Filters: and productstatus != 0 and productsubtype='Conditioner' and exists (select * from productproductcats where productproductcats.productid=products.productid and productcatid=17) and not exists (select * from productproductcats where productproductcats.productid=products.productid and productcatid='19')