Sql-Common Table Expression(CTE)
2013-08-05 11:24
363 查看
Select Statement是用来从数据库筛选数据, 所选出的数据结果存储在一张结果表里面(Result table),称之为结果集(Result - set).
很多时候,我们想将选出的结果集存储在一张临时表里, 用以做以后的数据操作, 此时,我们可以特指一个临时结果集, 称之为 a common table expression (CTE)。 CTE来源于单个的简单查询,例如执行一个Select, Insert, Update, 或者是Delete的陈述。
例如:
WITH GTE_NAME(COL1, COL2, COL3) AS
(
select A,B,C from table1
)
select GTE_NAME.* from GTE_NAME
很多时候,我们想将选出的结果集存储在一张临时表里, 用以做以后的数据操作, 此时,我们可以特指一个临时结果集, 称之为 a common table expression (CTE)。 CTE来源于单个的简单查询,例如执行一个Select, Insert, Update, 或者是Delete的陈述。
例如:
WITH GTE_NAME(COL1, COL2, COL3) AS
(
select A,B,C from table1
)
select GTE_NAME.* from GTE_NAME
相关文章推荐
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
- Sql 2008 Study for two ------CTE(Command Table Expression)
- SQL 研究- Common Table Expression
- Common Table Expression(CTE)
- sql server Common Table Expressions(CTE) 实现递归查询
- 姚博文 cte 公用表表达式Common Table Expression
- SQL Server 2005 CTE (Common Table Expression)
- CTE(common table expression)
- SQL-公用表表达式(Common Table Expression)
- CTE(Common Table Expressions)简单介绍(三)
- common table expression
- WITH common_table_expression (Transact-SQL)
- CTE(Common Table Expressions)简单介绍(四)