Skip to main content

Introducing new learning courses and educational videos from Apress. Start watching

Discovering Ranking Functions

  • 744 Accesses

Abstract

The four ranking functions were introduced to T-SQL by Microsoft in 2005. Three of the functions, ROW_NUMBER, RANK, and DENSE_RANK, assign a sequential number to each row in a query's results. The fourth ranking function, NTILE, divides the rows by assigning a bucket number to each row in the results. The group of low-ranking rows gets an NTILE value of 1 while the highest-ranking group of rows is assigned the top number.

This is a preview of subscription content, access via your institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-1-4842-5197-3_2
  • Chapter length: 21 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
USD   29.99
Price excludes VAT (USA)
  • ISBN: 978-1-4842-5197-3
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   39.99
Price excludes VAT (USA)
Figure 2-1
Figure 2-2
Figure 2-3
Figure 2-4
Figure 2-5
Figure 2-6
Figure 2-7
Figure 2-8
Figure 2-9
Figure 2-10
Figure 2-11
Figure 2-12
Figure 2-13

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and Permissions

Copyright information

© 2019 Kathi Kellenberger, Clayton Groom, and Ed Pollack

About this chapter

Verify currency and authenticity via CrossMark

Cite this chapter

Kellenberger, K., Groom, C., Pollack, E. (2019). Discovering Ranking Functions. In: Expert T-SQL Window Functions in SQL Server 2019. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5197-3_2

Download citation