Avez-vous simplement essayé d'ajouter une condition where dans la sous-requête ?
SELECT a.name , a.partnumber , a.supplier , a.cost FROM table1 a JOIN ( SELECT name , partnumber , MIN(cost) cost FROM table1 where stock > 0 GROUP BY name , partnumber ) b ON a.name = b.name AND a.cost = b.cost AND a.partnumber = b.partnumber