Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Cool NTILE() Window Function For

Share this post!
 Vote this!

WHAT IS NTILE()

In this post we are going to look at NTILE, a cool function that allows you to segment query results into groups and put numbers onto them. The name is easy to remember because it can create any -tile, a percentile, a decile, or anything else. In short, an n-tile. But it is much easier to understand with an example, so let's go right to it.

Support in Major Servers

SQL Server calls these functions Ranking Functions.
PostgreSQL supports a wider range of functions than MS SQL Server, having put them in at 8.4, and PostgreSQL and calls them Window Functions.
Oracle's support is broader (by a reading of the docs) than SQL Server or PostgreSQL, and they call them Analytic Functions.

More...

RECOMMENDED RADING

Recursive Queries with Common Table Expressions



0 comments:

Post a Comment