Click here to Skip to main content
12,632,113 members (25,849 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

20.5K views
2 bookmarked
Posted

SQL SERVER – 2012 – Summary of All the Analytic Functions – MSDN and SQLAuthority

, 26 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
SQL SERVER – 2012 – Summary of All the Analytic Functions – MSDN and SQLAuthority

SQL Server 2012 (RC0 available here) has introduced new analytic functions. These functions were long awaited and I am glad that they are now here. Before when any of these functions was needed, people used to write long T-SQL code to simulate these functions. But now, there’s no need of doing so. Having available native function helps performance as well as readability.

In the last few days, I have written many articles on this subject on my blog. The goal was to make these complex analytic functions easy to understand and make them widely accepted. As these new functions are available and as awareness spreads about them, we should start using these new functions. Here is a quick list of the new functions and relevant MSDN sites:

FunctionSQLAuthorityMSDN
CUME_DISTCUME_DISTCUME_DIST
FIRST_VALUEFIRST_VALUEFIRST_VALUE
LAST_VALUELAST_VALUELAST_VALUE
LEADLEADLEAD
LAGLAGLAG
PERCENTILE_CONTPERCENTILE_CONTPERCENTILE_CONT
PERCENTILE_DISCPERCENTILE_DISCPERCENTILE_DISC
PERCENT_RANKPERCENT_RANKPERCENT_RANK

I also enjoyed three different puzzles during the course of this series which gave a clear idea about the SQL Server 2012 analytic functions.

This series will always be my dear series as during this series I had went through a very unique experience of my book going out of stock and becoming available after 48 hours.

Reference: Pinal Dave (http://blog.SQLAuthority.com)


Filed under: CodeProject, Pinal Dave, PostADay, SQL, SQL Authority, SQL Function, SQL Query, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

pinaldave
Founder http://blog.SQLAuthority.com
India India
Pinal Dave is a Microsoft Technology Evangelist (Database and BI). He has written over 2200 articles on the subject on his blog at http://blog.sqlauthority.com. Along with 8+ years of hands on experience he holds a Masters of Science degree and a number of certifications, including MCTS, MCDBA and MCAD (.NET). He is co-author of two SQL Server books - SQL Server Programming, SQL Wait Stats and SQL Server Interview Questions and Answers. Prior to joining Microsoft he was awarded Microsoft MVP award for three continuous years for his contribution in community.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralMy vote of 1 Pin
Member 1040790017-Mar-14 2:58
memberMember 1040790017-Mar-14 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 26 Nov 2011
Article Copyright 2011 by pinaldave
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid