I wonder if I have data like
scoring name A 2 B 5 C 7
I would like to have a third row
total name score A 2 14 B 5 14 C 7 14
Ultimately, I want to find & z scores; or percentiles of several row entries in different totals. I'm just not sure if there's a simple way to compare the values of the rows with the added values, except for a subquery like
select A.name, A.score, B.total from my table A join the left (select name, sum (score) of myTable group by name) B in A.name = B.name
That could work but it seems inefficient to consult the same table twice to know what a calculation is. Is there any simpler way to do it that I'm missing?