¿Has intentado simplemente agregar una condición where dentro de la subconsulta?
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