From the course: Advanced SQL for Data Science: Time Series

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Percent rank

Percent rank - SQL Tutorial

From the course: Advanced SQL for Data Science: Time Series

Start my 1-month free trial

Percent rank

- [Instructor] Now, in addition to an integer value indicating rank, another function that we can apply is called percent rank. Let's take a look at that. And when we execute this, we don't get an integer value. Instead, we get a real number, and basically this is the rank divided by the total number of rows. So if you're looking to order rows, the two ways that you can use to measure that or to mark that is by using rank, which will give you an integer value, or percent rank, which will give you a value relative to the total number of rows.

Contents