Help decipher

hello,

Please what does this code mean?

from FewData m
left join (select act_ref, sum(qtypaid) totqtypaid
from FewData n
group by act_ref) t on m.act_ref = t.act_ref

Hello,

I' m guessing you want to add a column next to FewDATA columns that summarizes the qtypaid over partition act_ref.
Does your code work?

If this is the case you should try this:

SELECT act_ref, SUM(qtypaid) OVER (PARTITION BY act_ref) AS totqtypaid
FROM FewDATA