Filters: and productstatus != 0 and productsubtype='Testing Kits' and exists (select * from productproductcats where productproductcats.productid=products.productid and productcatid=1) and not exists (select * from productproductcats where productproductcats.productid=products.productid and productcatid='2')