Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Articles with tag CTE Rss

Search for any content tagged cte

   Items 1 to 18 of 18   
 

Nesting Levels in SQL

The 'Structured' part of SQL denotes the fact that queries can be nested inside each other in such a way that, wherever you can use a table, you can use a table expression. Such derived tables can provide powerful magic, to which is added CTEs and Lateral Tables.   Read more...
By Additional Articles 2014/02/11 | Source: SimpleTalk | Category: structure
Rating:  Rate this |   Briefcase | 3,812 reads

How to Compare Rows within Partitioned Sets to Find Overlapping Dates

How to Compare Rows within Partitioned Sets to Find Overlapping, Contiguous, or Gap dates  Read more...
By Kevin Wu 2013/12/25 (first published: 2010/10/11) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 6,827 reads

Common table expressions and circular references

Finding circular references that are stopping your CTE from working.  Read more...
By Geoff Norman 2013/09/02 (first published: 2011/01/31) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 15,870 reads

Displaying Sorted Hierarchies (SQL Spackle)

Learn how you can query a hierarchy of data and also return the results in an ordered fashion. A handy T-SQL skill that you will use over and over again.  Read more...
By Jeff Moden 2013/08/23 (first published: 2011/03/10) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 16,385 reads

Exploring Recursive CTEs by Example

Recursive CTEs can be confusing and scary, so examining some non-standard examples may cast light upon these shadowy demons.  Read more...
By Dwain Camps 2012/07/17 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 11,459 reads

Pros and cons of six SQL table tools

This article shows how to use 6 SQL table-based tools to solve the same problem, and gives the pros and cons of each.  Read more...
By Andy Owl 2011/12/26 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 8,606 reads

Dealing with Incomplete Data - A T-SQL Puzzle 1

Client data received for processing may have invalid records based on processing requirements. Identifying and dealing with bad records in a specific scenario is the object of this article.  Read more...
By Suresh Maganti 2011/11/22 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 3,304 reads

Calculating Stock Returns Using the ROW_NUMBER function and CTEs

In finance, when pricing data isn't available on last day of week, month or year, calculating returns is tricky. This article addresses the issue.   Read more...
By John Ryle 2011/10/18 | Source: SQLServerCentral.com | Category: common table expressions
Rating: |  Discuss |   Briefcase | 5,314 reads

Hidden RBAR: Counting with Recursive CTE's

"Counting" is essential to many high performance code techniques. SQL Server MVP, Jeff Moden, shows us how to make sure that we're "Counting" and not "Crippling" our trick-code.  Read more...
By Jeff Moden 2011/08/08 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 10,961 reads

Displaying Sorted Hierarchies (SQL Spackle)

Learn how you can query a hierarchy of data and also return the results in an ordered fashion. A handy T-SQL skill that you will use over and over again.  Read more...
By Jeff Moden 2013/08/23 (first published: 2011/03/10) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 16,385 reads

Concatenating Rows

Often in database design we store different values in rows to take advantage of a normalized design. However many times we need to combine multiple rows of data into one row for a report of some sort. New author Carl P. Anderson brings us some interesting T-SQL code to accomplish this.  Read more...
By Carl P. Anderson 2011/03/04 (first published: 2009/10/14) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 147,238 reads

Common table expressions and circular references

Finding circular references that are stopping your CTE from working.  Read more...
By Geoff Norman 2013/09/02 (first published: 2011/01/31) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 15,870 reads

How to Compare Rows within Partitioned Sets to Find Overlapping Dates

How to Compare Rows within Partitioned Sets to Find Overlapping, Contiguous, or Gap dates  Read more...
By Kevin Wu 2013/12/25 (first published: 2010/10/11) | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 6,827 reads

An Urgent Ad Hoc Report

In this new article, Yakov Shlafman shows us how he wrote a quick ad hoc report of expenses so that he could leave on time one day.  Read more...
By Yakov Shlafman 2010/03/17 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 8,041 reads

Calculating Moving Averages with T-SQL

How to efficiently calculate moving averages with SQL Server using Stock Market data.  Read more...
By Gabriel Priester 2010/03/04 | Source: SQLServerCentral.com | Category: moving average
Rating: |  Discuss |   Briefcase | 14,853 reads

Convert String to a Table using CTE

Explains how to convert a list of Ids passed as string and convert it to a table  Read more...
By Amit Gaur 2009/12/14 | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 12,745 reads

Concatenating Rows

Often in database design we store different values in rows to take advantage of a normalized design. However many times we need to combine multiple rows of data into one row for a report of some sort. New author Carl P. Anderson brings us some interesting T-SQL code to accomplish this.  Read more...
By Carl P. Anderson 2011/03/04 (first published: 2009/10/14) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 147,238 reads

The Dynamic Tally or Numbers Table

Building a tally table is a common T-SQL problem that many new developers struggle with. Lynn Pettis brings us an article that shows how to use CTEs to accomplish this.  Read more...
By Lynn Pettis 2009/09/22 | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 9,163 reads
   Items 1 to 18 of 18