SQL - Group Values by Percentile/Merge Rankings
<p>I have multiple tables that contain the name of a company/attribute and a ranking. </p>

<p><a href="https://i.stack.imgur.com/mZo8z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mZo8z.png" alt="enter image description here"></a></p>

<p>I would like to write a piece of code which allows a range of Scores to be placed into specific Groups based on the percentile of the score in relationship to tables Score total. I provided a very easy use case to demonstrate what I am looking for, splitting a group of 10 companies into 5 groups, but I would like to scales this in order to apply the 5 groups to data sets with many rows WITHOUT having to specify values in a CASE statement. </p>

<p><a href="https://i.stack.imgur.com/I5qLS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I5qLS.png" alt="enter image description here"></a></p>