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

Content with tag CTE Rss

   Items 1 to 20 of 31    Older >>
 

Standard Deviations with CTE in SQL

I was working with a client recently getting the number of standard deviations a student was off the average number...  Read more...
By MikeDavis 2014/02/27 | Source: SQLServerCentral Blogs | Category: blogs
Rating: (not yet rated) |  Discuss |   Briefcase | 1,473 reads

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

CTE

By Samith C 2013/09/25 | Category: cte
Rating: (not yet rated) |  Discuss |   Briefcase | 2,804 reads

Sales Report on a View

Sales Report based on a single view  Read more...
By Sergiu Ungureanu 2013/09/17 | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 1,195 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,386 reads

Virtual tally table function

An inline table-valued function (iTVF) that will produce a virtual tally table on-the-fly. The function creates a tally table of any size with user-defined lower and upper bounds.  Read more...
By Steven Willis 2013/07/23 | Source: SQLServerCentral.com | Category: tally
Rating: |  Discuss |   Briefcase | 1,041 reads

Generate N numbers

Reursive CTE Script to generate n numbers  Read more...
By Harsha Majety 2013/04/17 | Source: SQLServerCentral.com | Category: recursion
Rating: |  Discuss |   Briefcase | 1,333 reads

Multiple CTEs

Multiple CTEs It’s somewhat obscure in BOL and I wasn’t able to find any examples but it turns out you can...  Read more...
By Kenneth Fisher 2012/10/11 | Source: SQLServerCentral.com | Category: blogs
Rating: (not yet rated) |  Discuss |   Briefcase | 2,892 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,460 reads

Convert a string list to TABLE with single CTE query

Converts a string list into a table using a single query, no variables and no helper functions.  Read more...
By Dimitris Staikos 2012/05/11 | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 2,041 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

Display multiple rows values as single row value (Different Columns)

Display multiple rows values as single row value in different rows (No Cursor).  Read more...
Rating: |  Discuss |   Briefcase | 2,900 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,386 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
   Items 1 to 20 of 31    Older >>
 
Tags
t-sql (19)    
recursion (8)    
row_number() (3)    
blogs (2)    
tally table (2)    
common table expression (1)    
common table expressions (1)    
counter (1)    
cursor (1)    
date manipulation (1)    
derived table (1)    
ema (1)    
hierarchy (1)    
holiday (1)    
humor (1)    
ids to table (1)    
interstorm (1)    
lateral tables (1)    
list (1)    
loop (1)    
macd (1)    
michael davis (1)    
moving average (1)    
mstvf (1)    
nested queries (1)    
output clause (1)    
partition (1)    
partitioned sets (1)    
pivot (1)    
recursive (1)    
search (1)    
sma (1)    
sql server 2005 (1)    
sql spackle (1)    
string manipulation (1)    
string to table (1)    
structure (1)    
table expression (1)    
table variables (1)    
table-valued function (1)    
tally (1)    
views (1)    
while (1)