I wanted to know how to get the distinct sum of products
The table I have
Name Rating
A 3
A 3
B 4
C 3
C 3
The final result I want is
SUM(case when distinct table1.name then rating)/Count(case when distinct table1.name then rating)
final answer = (3+4+3)/3 = 10/3 = 3.33
Thanks in advance