Instruction

Great job. So, to sum up this section, remember the following rule: the only places where we can use window functions without having to write subqueries are the SELECT and ORDER BY clauses. In all other places you have to use subqueries.

Exercise

You've seen several examples where the window function was placed in the SELECT clause, but how about trying to put it in the ORDER BY clause now?

For each auction, show the following columns: id, views and quartile based on the number of views in descending order. Order the rows by the quartile.

Stuck? Here's a hint!

In the ORDER BY clause, write the same window function as in the SELECT clause.

Need assistance?

Our website uses cookies. By using this website, you agree to their use in accordance with the browser settings.You can modify your browser settings on your own. For more information see our Privacy Policy.