Percent rank is defined as the number of values that are the same or less than the current value divided by one less than the number of values. Percent rank is different than PERCENTILE, stay tuned for PERCENTILE_DISC and PERCENTILE_CONT which are different from PERCENT_RANK. For this example I will be using the same revenue table in the sample database …

More TSQL Analytic Functions – PERCENT_RANK Read more »

SQL Server – TSQL Analytics Word Search   Find the following words in the word scramble above. TOP RANK DENSE_RANK ROW_NUMBER NTILE OVER LAG LEAD FIRST_VALUE LAST_VALUE PERCENT_RANK PERCENTILE_DISC PERCENTILE_CONT CUME_DIST PARTITION ROWS PRECEDING FOLLOWING UNBOUNDED   Download the Printable PDF of the Word Search. See Also TSQL Queries – Using NTILE TOP, Ranking, NTILE, and Aggregate Functions TSQL Analytics FREE …

SQL Sunday Word Scramble Read more »

As posted earlier. This weeks SQL Queries training for the 70-461 certification will be on Thursday at 9:00am (US pacific time). Please join the live broadcast on Google On Air Hangouts, or catch the recorded version on myYouTube Channel. Aaron Buma will be presenting the first half of the session and I will be presenting the second half. We will …

Downloads for this weeks SQL Training Read more »

This weeks SQL Queries training for the 70-461 certification will be on Thursday at 9:00am (US pacific time). Please join the live broadcast on Google On Air Hangouts, or catch the recorded version on my YouTube Channel. Aaron Buma will be presenting the first half of the session and I will be presenting the second half. We will start off …

This Weeks SQL Server Queries Training Read more »

    Click on the grid to enlarge, then print it. Find the following words in the grid up, down, left, right, horizontal, vertical, and diagonal. ROWS  RANGE  PRECEDING  FOLLOWING  UNBOUNDED  IIF  CHOOSE  OFFSET  FETCH  FORMAT  CONCAT  SEQUENCE  PARSE  TRYPARSE  TRYCONVERT  THROW  LEAD  LAG  FIRSTVALUE  LASTVALUE  PERCENTRANK  CUMEDIST  PERCENTILEDISC  PERCENTILECONT  NOTE:  some of these terms normally have an underscore in …

SQL Sunday Fun – Word Search with New T-SQL 2012 Functionality Read more »

It has been a year since SQL Server 2012 released. There were some fun posts on Twitter about the SQL Server 2012 birthday or anniversary. For instance: and another anniversary query (which doesn’t actually run): 1 year out since SQL 2012 released, and here are some things to note: There is no more Business Intelligence Development Studio (BIDS) in SQL …

Happy Birthday SQL Server 2012 Read more »

So far after playing around with SQL Server 2012 there are many new features to SQL.  Overall I think my favorites are in the Analytic Functions category.  Here is my breakdown of the top 10 transact SQL enhancements to SQL Server 2012. 10.  New SEQUENCE object 9.  CHOOSE function 8.  Analytics – Analytic Functions – PERCENT_RANK 7.  Analytics PERCENTILE_DISC and PERCENTILE_CONT 6. …

My Top 10 TSQL Enhancements in SQL Server 2012 Read more »

Like the other new Analytic functions, PERCENTILE_DISC and PERCENTILE_CONT require the use of the OVER clause. For this example I will be using almost the same revenue table in the sample database that I set up for the LEAD and LAG posting earlier in the week, and the PERCENT_RANK posting yesterday, just a few values changed to show the differences between these …

More TSQL 2012 Analytics PERCENTILE_DISC and PERCENTILE_CONT Read more »

Percent rank is defined as the number of values that are the same or less than the current value divided by one less than the number of values. Percent rank is different than PERCENTILE, stay tuned for PERCENTILE_DISC and PERCENTILE_CONT which are different from PERCENT_RANK. For this example I will be using the same revenue table in the sample database …

More TSQL Analytic Functions – PERCENT_RANK Read more »

SQL Server 2012 introduces 8 new analytic functions. This post will cover 2 of them LEAD and LAG, which can be used to reference a value in the row before or the row after the current row. If you have read my OVER clause articles you will recognize the REVENUE table. Just a table listing department revenue year over year …

TSQL Analytic Functions LEAD and LAG Read more »