SQL Server: Using RANK to display PERCENT (percentage of relevance)

So you end up with a query like this:

That yields something like this:

ID ... KEY RANK
5  ...  5  765
2  ...  2  322
3  ...  5  128
1  ...  1   75

And you are missing a percentage column. Well, not any more!

* SQL SERVER 2012 now supports LOG ( float_expression [, base ] ). This means you do it this way: LOG(RANK, SUM(RANK) OVER( PARTITION BY 1))

Thanks Alex!