I usually do not comment on a video but this is a gem of a video. Precise, accurate and no bs video! I keep coming back to this video whenever I'm rusty with ranking. Thank you!
Thank your for precise explanation.. As you have mentioned, if I need to fetch the earliest record from a table which should order by a timestamp, then the logic will be similar to that of the one you have explained about fetching records for lowest salary ?
I have a doubt ...you explained that to remove ties we will use row_number() and you kept hiredate in order by along with sal.. So can't we use the same in dense_rank() also..like order by dal, hiredate?????
I have a doubt ...you explained that to remove ties we will use row_number() and you kept hiredate in order by along with sal.. So can't we use the same in dense_rank() also..like order by dal, hiredate?????
Yes, you could do that with this data and it would give the same result, BUT that is just for this data set. What if two people joined on the same day with the same salary? They would have a tie and RANK/DENSE_RANK would still show ties. ROW_NUMBER is guaranteed not to show ties. The point of adding HIREDATE was to show that you might want to consider alternative criteria to try and get some consistency in the output. Without this you would not be certain which of the tied rows you were getting each time you ran the query. It wasn't meant to indicate that ROW_NUMBER was somehow fundamentally different in the way the ORDER BY can be used.
I usually do not comment on a video but this is a gem of a video. Precise, accurate and no bs video! I keep coming back to this video whenever I'm rusty with ranking. Thank you!
this video is such a gem. too good to be on youtube
Thank you your great explanation, very simpe and sreight forward.
Thank you for the clear explanation and examples.
quick, consise and accurate. thanks mate.
Thanks. This video is really informative.
video good quality - explanation clear, simple and easy to understand - very helpful . Thanks a lot
subbed
Thanks bro
Very useful and understanding in less time. Thank you
GREAT VIDEO ..keep going. cheers
Thank you for such a great and precise explanation :)
Please keep doing more of this...maybe some interview type questions etc...just suggesting, You rock Tim !! :)
More and good explanation Thank you.
Really useful totally agree with Pallavi, and i have book marked this video
That was helpful. Thank you!
This is so short and sweet. Thanks bro
PRECISE AND THE BEST EXPLAINATION
you are awesome
Great
SIMPLE AND STRAIGHT FORWARD
U sir, are a Hero..!
excellent
Thank your for precise explanation.. As you have mentioned, if I need to fetch the earliest record from a table which should order by a timestamp, then the logic will be similar to that of the one you have explained about fetching records for lowest salary ?
Yes. You will order by the timestamp column in the analytic clause.
awesome
👍👍
Good explanation
Awesome sir
I have a doubt ...you explained that to remove ties we will use row_number() and you kept hiredate in order by along with sal.. So can't we use the same in dense_rank() also..like order by dal, hiredate?????
I have a doubt ...you explained that to remove ties we will use row_number() and you kept hiredate in order by along with sal.. So can't we use the same in dense_rank() also..like order by dal, hiredate?????
Yes, you could do that with this data and it would give the same result, BUT that is just for this data set. What if two people joined on the same day with the same salary? They would have a tie and RANK/DENSE_RANK would still show ties. ROW_NUMBER is guaranteed not to show ties.
The point of adding HIREDATE was to show that you might want to consider alternative criteria to try and get some consistency in the output. Without this you would not be certain which of the tied rows you were getting each time you ran the query. It wasn't meant to indicate that ROW_NUMBER was somehow fundamentally different in the way the ORDER BY can be used.
LEGEND