select distinct p.name, w.name, sum(g.quantity) as "count"
from product p, warehouse w, goods g
where (goods.productId = product.id and goods.warehouseId = warehouse.id
and p.id in
(select productid from
(select productid, sum(quantity) from goods group by productid having sum(quantity) > 100) sq1
) sq2
group by p.name, w.name
order by sum(g.quantity) desc
Используя два подзапроса. Криво, но должно сработать.