The main row will get rank 1, and the next rows get greater rankings. If any rows contain the very same benefit inside the column used for purchasing, These are ranked the exact same. The RANK() purpose leaves gaps in this kind of circumstances. You'll find distinct generalizations of your https://rsac.org