Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Content with tag window functions Rss

   Items 1 to 20 of 24    Older >>
 

Reaping the benefits of the Window functions in T-SQL

Exploring the potential benefits of the T-SQL Window functions (OVER, LAG, and LEAD) in this piece. You can learn how to achieve up to 50% performance boost by replacing a single function call.   Read more...
By Eirikur Eiriksson 2016/04/22 (first published: 2014/03/24) | Source: SQLServerCentral.com | Category: sql server 2012
Rating: |  Discuss |   Briefcase | 12,465 reads

T-SQL Window Function Speed Phreakery: The FIFO Stock Inventory Problem

Sometimes, in the quest for raw SQL performance, you are forced to sacrifice legibility and maintainability of your code, unless you then document your code lavishly. Phil Factor's SQL Speed Phreak challenge produced some memorable code, but can SQL features introduced since then help to produce code that performs as well and is also easy to understand? Kathi Kellenberger investigates.  Read more...
By Additional Articles 2016/04/15 | Source: SimpleTalk | Category: fifo
Rating:  Rate this |   Briefcase | 5,338 reads

The Lonely Count

By Steve Jones 2016/01/07 | Category: window functions
Rating: (not yet rated) |  Discuss |   Briefcase | 1,571 reads

Cursor-Killing: Accessing Data in the Next Row

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? This first part in an ongoing series of cursor-killing handles inter-row analysis.  Read more...
By Edward Pollack 2015/12/18 (first published: 2014/05/27) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 21,476 reads

Understanding the OVER clause

Having a solid knowledge of the window functions if vital to high performance T-SQL Code. The key to these functions is how the OVER clause is used. This article will dive into how to use the OVER clause.  Read more...
By Wayne Sheffield 2015/10/14 | Source: SQLServerCentral.com | Category: over clause
Rating: |  Discuss |   Briefcase | 16,331 reads

LEAD parameters

By Steve Jones 2015/05/15 | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 1,679 reads

Using LAG

By Kathi Kellenberger 2015/04/15 | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 1,869 reads

Using LAST_VALUE

When I began using LAST_VALUE, the results were not what I expected at all. Read on to learn the secret!  Read more...
By Kathi Kellenberger 2015/04/14 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 17,320 reads

Running Total Performance

By Kathi Kellenberger 2015/04/03 | Category: running totals
Rating: (not yet rated) |  Discuss |   Briefcase | 1,837 reads

Cursor-Killing: Accessing Data in the Next Row

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? This first part in an ongoing series of cursor-killing handles inter-row analysis.  Read more...
By Edward Pollack 2015/12/18 (first published: 2014/05/27) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 21,476 reads

Reaping the benefits of the Window functions in T-SQL

Exploring the potential benefits of the T-SQL Window functions (OVER, LAG, and LEAD) in this piece. You can learn how to achieve up to 50% performance boost by replacing a single function call.   Read more...
By Eirikur Eiriksson 2016/04/22 (first published: 2014/03/24) | Source: SQLServerCentral.com | Category: sql server 2012
Rating: |  Discuss |   Briefcase | 12,465 reads

The Performance of the T-SQL Window Functions

Window Functions in SQL greatly simplify a whole range of financial and statistical aggregations on sets of data. Because there is less SQL on the page, it is easy to assume that the performance is better too: but is it? Dwain gets out the test harness to investigate.  Read more...
By Additional Articles 2014/02/06 | Source: SimpleTalk | Category: t-sql
Rating:  Rate this |   Briefcase | 4,693 reads

All the rows before this one

By Steve Jones 2013/12/20 | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 2,238 reads

Windowing Ranges

By Steve Jones 2013/12/09 | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 2,328 reads

High-Performance Transact-SQL with Window Functions

Window functions are more intuitive and simpler in many cases than alternative SQL methods.  Read more...
By Kamil Moscicki 2013/12/02 | Source: SQLServerCentral.com | Category: sql performance
Rating: |  Discuss |   Briefcase | 8,331 reads

Window Functions in SQL

SQL's windowing functions are surprisingly versatile, and allow us to cut out all those self-joins and explicit cursors. Joe Celko explains how they are used, and shows a few tricks such as calculating deltas in a time series, and filling in gaps.   Read more...
By Additional Articles 2013/11/14 | Source: SimpleTalk | Category: window functions
Rating: (not yet rated)  Rate this |   Briefcase | 7,058 reads

Calculating Values within a Rolling Window in Transact SQL

Before the SQL Window functions were implemented, it was tricky to calculate rolling totals or moving averages efficiently in SQL Server. There are now a number of techniques, but which has the best performance? Dwain Camps gets out the metaphorical stopwatch.  Read more...
By Additional Articles 2013/11/01 | Source: SimpleTalk | Category: window functions
Rating: (not yet rated)  Rate this |   Briefcase | 4,225 reads

SQL Server 2012 Window Function Basics

For some time, Microsoft had a few window functions, but not the full set specified in the SQL 2003 standard. Now, in SQL Server 2012 we have the whole range, and extremely useful they are too. There's no longer an excuse to avoid them, particularly now you have Rob Sheldon's gentle introduction.  Read more...
By Additional Articles 2013/04/04 | Source: SimpleTalk | Category: sql server 2012
Rating:  Rate this |   Briefcase | 4,600 reads
   Items 1 to 20 of 24    Older >>
 
Tags
t-sql (13)    
over clause (4)    
lag (3)    
lead (3)    
sql server 2012 (3)    
performance (2)    
window aggregate (2)    
analytic functions (1)    
analytical functions (1)    
blogs (1)    
count() (1)    
cte (1)    
cursors (1)    
datediff (1)    
fifo (1)    
first_value (1)    
framing (1)    
last_value (1)    
performance tuning (1)    
rows and range (1)    
running totals (1)    
sql performance (1)