select name, round(sum(amount_paid) /
(select amount_paid from order_items) * 100.0, 2) as pct
from order_items amount_paid
group by 1
order by 2 desc;
Can someone help me and show me where the mistake is? Thanks mate
select name, round(sum(amount_paid) /
(select amount_paid from order_items) * 100.0, 2) as pct
from order_items amount_paid
group by 1
order by 2 desc;
Can someone help me and show me where the mistake is? Thanks mate
select name, round(sum(amount_paid) /
(select sum(amount_paid) from order_items) * 100.0, 2) as pct
from order_items
group by 1
order by 2 desc;