CTE(common table expression)
A common table expression (CTE) is a temporary result set
that is defined within the execution scope of a single
SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW statement. A
CTE is similar to a derived table in that it is not stored
as an object and lasts only for the duration of the query.
Unlike a derived table, a CTE can be self-referencing and
can be referenced multiple times in the same query.
A CTE can be used to:
1. Create a recursive query.
2. Substitute for a view when the general use of a view is
not required; that is, you do not have to store the
definition in metadata.
3. Reference the resulting table multiple times in the same
statement.
4. Enable grouping by a column that is derived from a scalar
subselect, or a function that is either not deterministic or
has external access.
Is This Answer Correct ? | 9 Yes | 0 No |
what's new in sql server 2016?
whate is advantages of sql server 2000
Can we rewrite subqueries into simple select statements or with joins? Example?
Delete duplicate rows from a table without primary key by using a single query Table Employee empname salary A 200 B 300 A 200 C 400 D 500 D 500 Output should be A 200 B 300 C 400 D 500
What is raid? : SQL Server Architecture
If user is owning any SQL Objects, can we drop that user
How much memory that we are using in Logshipping Concept?
What is user-defined functions? What are the types of user-defined functions that can be created?
How do you connect 100 files as a flat file sources in one package of SSIS?
What are xml indexes?
What are the character string functions supported by sql server 2005?
write down the code for "how we delete a table without using of Drop command " ?
7 Answers CarrizalSoft Technologies, Sonata,