Czy próbowałeś po prostu dodać warunek WHERE w podzapytaniu?
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