select * from prod where (SELECT count(*) FROM Pro WHERE Pro.Cod=Prod.Cod AND coalesce(Quant, 0) <> 0) = 0