Skip to content

Commit 6a6c163

Browse files
committed
understanding difference between rank, dense rank and row number
1 parent d739b7f commit 6a6c163

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- talking about the difference
2+
-- firstly talk about similarities
3+
4+
5+
-- when there are no duplicates in the data according to the order by clause column
6+
-- then each will give integer numbering starting with 1 and goes till the last row number
7+
8+
-- but if there are duplicates in the data according to the order by clause column
9+
-- then
10+
-- row_number will act as same - 1, 2, 3, 4, 5
11+
-- rank : 1, 1, 3, 4, 5 - it will skip the rank for the duplicate entry and then start with next rank
12+
-- dense_rank: 1, 1, 2, 3, 4- it will not skip the rank either it will give next rank to the other row when there are ties
13+

0 commit comments

Comments
 (0)