Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 17431 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > SQL Server Interview Questions > Explain Common Table Expression(CTE) in ...

Explain Common Table Expression(CTE) in SQL Server

Interview question and answer by: CGN007 | Posted on: 7/20/2012 | Category: SQL Server Interview questions | Views: 601 | | Points: 40
Ads
Ads


Answer:

The common table expression (CTE) is a temporary named result set that you can reference within a SELECT, INSERT, UPDATE, or DELETE statement.
A CTE is defined with two parts:

A WITH clause containing a SELECT statement that generates a valid table
An outer SELECT statement that references the table expression.

The basic syntax structure for a CTE is:

WITH expression_name [ ( column_name [,...n] ) ] 

AS
( CTE_query_definition )

SELECT <column_list> FROM expression_name;

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


 Responses

Posted by: Sqldev | Posted on: 11 Mar 2013 11:14:47 PM | Points: 10 | Alert Moderator 

Hi,

Below video have complete information about CTE like what is CTE , properties of CTE and examples for CTE in sql server.

http://www.youtube.com/watch?v=Ly-YqPVdVOk&feature=youtu.be


Best Regards,
Sql Expert
http://learnsqltips.blogspot.com/

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from CGN007

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 8:17:11 PM