The 1st row will get rank one, and the next rows get bigger rankings. If any rows hold the same price within the column useful for buying, They're ranked a similar. The RANK() operate leaves gaps in such situations. In control principle, the rank of the matrix can be employed https://rsac.org