O'Reilly logo

Teradata SQL by Tom Coffing, Mike Larkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12 - The Quantile Function

“There is flattery in friendship.”

- William Shakespeare

 

The Quantile Function and Syntax

The syntax for the Quantile function:

 

 

QUANTILE (<partitions>, <column-name> ,<sort-key> [DESC | ASC])[QUALIFY QUANTILE (<column-name>) {< | > | = | <= | >=} <number-of-rows>]

 

 

 

A Quantile is used to divide rows into a number of categories or grouping of roughly the same number of rows in each group. The percentile is the QUANTILE most commonly used in business. This means that the request is based on a value of 100 for the number of partitions. It is also possible to have quartiles (based on 4), tertiles (based on 3) and deciles (based on 10).

By default, both the QUANTILE column and the QUANTILE value itself ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required