Home    

  Life Checker

Career Check

Family Check

PC Check

Debt Check

Company Check

Attitude Check

Net Check

Faith Check

Security Check

Health Check

 

RANKING FUNCTIONS

Rank()
Dense_Rank()
NTile()
Row_Number()

Each of these uses the OVER Clause to set up the query.

The coolest of these in my opinion is the NTILE function as it
will divide up a result set into value bands producing an auto-
matic set of categories. In the sample below 4 price ranges would
be created.

SELECT NTILE(4) OVER(Partition BY PRODUCT.NAME ORDER BY PRICE) as
PRICERANGE, PRODUCT.NAME, PRICE
FROM PRODUCT

 

SQL Notes

Success Blog

Tech Blog

Networking Articles

Career Advice

PC Notes

Debt Calculator

Deals

Security

Software

Preloaded

Tools For

Your PC