I have a table with 3 columns which looks like this:
File User Rating (1-5) ------------------------------ 00001 1 3 00002 1 4 000
WITH data AS (SELECT User, Rating, Count(*) AS Count FROM Results GROUP BY User, Rating) SELECT User, Rating, Count, (0.0+n)/(SUM(Count) OVER (PARTITION BY User)) FROM data;