Direct
SELECT * FROM tab
Select B,row_number () over (order by B) from tab
When the same data is encountered, the rankings are incremented in the order in which they are recorded in the record set. The same data is encountered without affecting the sort sequence number
Select B,rank () over (order by B) from tab
When the same data is encountered, all the same data is ranked the same at the same time, and the rank between the last same record and the next record rank is vacated.
The same sort order is affected by the same data, and the next data refers to the ranking of the entire table.
Select B,dense_rank () over (order by B) from tab
When the same data is encountered, all the same data is ranked the same at this time.
The same value is ordered, the next data is ranked
The difference between the database analysis function row_number () rank () Dense_rank ()