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

Content with tag CTE Rss

   Items 1 to 20 of 41    Older >>
 

Calculate Age (in years)

An inline table valued function (iTVF) that can be used to calculate age in years.  Read more...
By Alan Burstein 2016/04/27 | Source: SQLServerCentral.com | Category: date
Rating: |  Discuss |   Briefcase | 666 reads

Windowing Functions: Tell me when that changes.

Windowing functions aren't just for analyzing numbers/dates. Using windows functions to analyze when a character field changes is a little know resource  Read more...
By Michael Morin 2016/02/17 | Source: SQLServerCentral.com | Category: windows functions
Rating: |  Discuss |   Briefcase | 4,712 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,473 reads

Implementing John Conway's Game of Life in Microsoft SQL Server

A fun exercise, using CTEs to implement John Conway's Game of Life cellular automata simulation  Read more...
By Paul Chang 2015/09/22 | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 4,850 reads

CTE Problem Redux

By Steve Knox 2015/04/28 | Category: cte
Rating: (not yet rated) |  Discuss |   Briefcase | 1,673 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 2014/09/08 | Source: SQLServerCentral.com | Category: tally
Rating: |  Discuss |   Briefcase | 2,025 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 2014/07/25 (first published: 2012/07/17) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 22,239 reads

CTE DML

This script is an example explaining how to write DML using CTE.  Read more...
By kbhanu15 2014/07/23 | Source: SQLServerCentral.com | Category: dml
Rating: |  Discuss |   Briefcase | 1,620 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,473 reads

Duplicate Detection and Management

Inevitably, every DBA is eventually asked to delete, merge, or otherwise report on duplicate data. There are many tools at our disposal to make this task both simple and efficient to complete. Read on for simple steps and examples to effectively deal with duplicate data.  Read more...
By Edward Pollack 2014/04/29 | Source: SQLServerCentral.com | Category: duplicate
Rating: |  Discuss |   Briefcase | 6,435 reads

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 | 2,244 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 | 4,293 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 | 7,039 reads

CTE

By Samith C 2013/09/25 | Category: cte
Rating: (not yet rated) |  Discuss |   Briefcase | 2,921 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,377 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 | 16,272 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,837 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 2014/09/08 | Source: SQLServerCentral.com | Category: tally
Rating: |  Discuss |   Briefcase | 2,025 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,409 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 | 3,648 reads
   Items 1 to 20 of 41    Older >>
 
Tags
t-sql (22)    
recursion (8)    
common table expressions (cte) (3)    
row_number() (3)    
blogs (2)    
cursors (2)    
date manipulation (2)    
lag (2)    
lead (2)    
tally table (2)    
cellular automata (1)    
column aliases (1)    
common table expression (1)    
counter (1)    
cursor (1)    
date (1)    
datediff (1)    
derived table (1)    
dml (1)    
duplicate (1)    
ema (1)    
game of life (1)    
hierarchy (1)    
holiday (1)    
howto (1)    
humor (1)    
ids to table (1)    
inline table valued function (itvf) (1)    
interstorm (1)    
john conway (1)    
lateral tables (1)    
list (1)    
loop (1)    
macd (1)    
max (1)    
merge (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)    
set-based (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)    
window functions (1)    
windows functions (1)