Only this week, get the SQL Complete Track of 9 courses in a special prize of $330$89!
Introduction
Ranking functions
Selecting n-th row
Summary

Instruction

Let's get down to work. So far, you've learned how to use window functions with aggregate functions that you already know – SUM(), COUNT(), AVG(), MAX() and MIN().

Now, we'll teach you different functions that go well with OVER()ranking functions. The general syntax is as follows:

<ranking function> OVER (ORDER BY <order by columns>)

We'll introduce a few possible ranking functions in the next exercises.

As to OVER (ORDER BY col1, col2...), this is the part where you specify the order in which rows should be sorted and therefore ranked.

Exercise

Press to continue.