Common Table Expressions (CTE)

 

Intended Audience

Database programmers and administrators who are familiar with TRANSACT SQL, Subqueries, and advanced join techniques.

 

Abstract

Have you ever wanted to create a recursive query, but didn’t see how to do it.  With the Common Table Expressions class you will learn everything needed to start using CTE’s for recursive queries, as a temporary views, and to use the result set multiple times in the same query.  Learn how simplify query syntax using CTE’s.  One of the most overlooked features of SQL Server is the CTE which no only simplifies the query, but gives you the ability to do things that would otherwise be impossible (or at least very challenging) with SQL Server.  This presentation is targeted for database programmers and administrators who are familiar with TRANSACT SQL, Subqueries, and advanced join techniques.

 

Class Outline

  • Overview – What is a CTE
  • Syntax – Using a CTE with a SELECT statement
  • Query Recursion with CTE’s
  • Multiple CTE’s in a single query
  • Creating a Hierarchical List/Outline with Recursive CTE’s
  • Self JOINing CTE’s
  • Common CTE Use Cases
  • CTE’s with SSRS
  • Review and Final Demo

7 Responses to Common Table Expressions (CTE)

  1. Pingback: » Another Session Submitted for SQL Saturday Steve Stedman

  2. Pingback: » 2 Sessions Accepted for SQL Saturday 114 in Vancouver Steve Stedman

  3. Pingback: » Sessions Submitted for SQL Saturday #120 Orange County CA Steve Stedman

  4. Pingback: » CTE Query Performance Steve Stedman

  5. Pingback: » Session Accepted For SQL Saturday 108 in Redmond Steve Stedman

  6. Pingback: » Calculating Factorials with a Recursive CTE Steve Stedman

  7. Pingback: » Sessions for Code Camp in 2 weeks Steve Stedman

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by sweet Captcha