http:#a33193495 would have made a great question!
Select product_main.product_id, product_main.description,
sum(product_extension.quan
tity) as total_quantity,
sum(case when product_extension.location
= 'UK' then product_extension.quantity
end) as uk_quantity
FROM product_main INNER JOIN product_extension ON product_main.product_id = product_extension.product.
id
Group by product_main.product_id, product_main.description