Common table expression
From Wikipedia, the free encyclopedia
(Redirected from Common table expressions)
|
|
It has been suggested that this article or section be merged into Hierarchical query. (Discuss) Proposed since February 2009. |
A Common Table Expression, or CTE, (in SQL) is a temporary named result set, derived from a simple query and defined within the execution scope of a SELECT, INSERT, UPDATE, or DELETE statement.
CTEs can be thought of as alternatives to derived tables (subquery), views, and inline user-defined functions.
[edit] Common table expressions
Common table expressions are supported by DB2, Firebird [1], Microsoft SQL Server, Oracle, PostgreSQL, HyperSQL and H2 (experimental)[2]. Syntax:
WITH [RECURSIVE] with_query [, ...] SELECT...
with_query looks like
with_query_name [ (column_name [,...]) ] AS (SELECT ...)
[edit] External links
[edit] References
| This database software-related article is a stub. You can help Wikipedia by expanding it. |