Привет, наверное это хочешь получить?
select b.country_id, a.user_id, ROUND(a.amount_usd / cr.amount_usd * 100,2) as [percent]
from #orders a
join #users b on a.user_id=
b.id join (
select country_id, sum(amount_usd)amount_usd
from #users a
join #orders b on
a.id=b.user_id
group by country_id
) cr on cr.country_id = b.country_id