I want to add a column showing percentage values for Score, in which each record's score is divided by the sum of the scores for the category it's in. So the values in the new column should be 0.6, 0.4, 0.3 and 0.7.

```
Id   Category   Score
1    foo        6        
2    foo        4          
3    bar        30
4    bar        70

```

The best I can think to do is to create a temporary table that creates sum values for Score using GROUP BY and then JOIN-ing it to the main table. Is there a more efficient way of doing this?