Roll up functionality in SQL

in the exercise on "Roll up ", I don’t get the same results as shows, here is my query, slightly different but it works. Also , in group by i don’t mention the original name (name) but the alias method and still it works, can someone help. Thanks !

Select
paym.name as method,
sum(amount) as tot_amount
from
payment_methods paym
left join payments pay
on paym.payment_method_id = pay.payment_id
group by method with ROLLUP;

1 Like