how would you do this:
Tim ...
Tim ...
Henry ...
Henry ...
Henry ...
I have a table thatc ontains these names on the first column and I am interested in adding a new column X, that should have:
0.5
0.5
0.333
0.333
0.333
to count the number of distinct entries in the first column if you were to do the sum of the new column. Thank you!
You could use the following:
See SQL Fiddle with Demo