I have a table:
key product_code cost 1 UK 20 1 US 10 1 EU 5 2 UK 3 2 EU
This query gives me perfect result
select key, product_code, cost, sum(cost) over (partition by key) as total_costs from zone;