The first row receives rank one, and the next rows get larger rankings. If any rows have the exact price while in the column used for buying, They may be ranked exactly the same. The RANK() function leaves gaps in these kinds of circumstances. You'll find unique generalizations from the https://rsac.org