博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WITH common_table_expression (Transact-SQL)
阅读量:5094 次
发布时间:2019-06-13

本文共 1180 字,大约阅读时间需要 3 分钟。

 

Specifies a temporary named result set, known as a common table expression (CTE).

This is derived from a simple query and defined within the execution scope of a single SELECT, INSERT, UPDATE, or DELETE statement.

This clause can also be used in a CREATE VIEW statement as part of its defining SELECT statement.

A common table expression can include references to itself.

This is referred to as a recursive common table expression.

 

-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse  [ WITH 
[ ,...n ] ]
::= expression_name [ ( column_name [ ,...n ] ) ] AS ( CTE_query_definition )

 

 

Remarks

A CTE must be followed by a single SELECT, INSERT, UPDATE, or DELETE statement that references some or all the CTE columns.

A CTE can also be specified in a CREATE VIEW statement as part of the defining SELECT statement of the view.

 

 

Error

Incorrect syntax near the keyword 'with'.

If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

 

转载于:https://www.cnblogs.com/chucklu/p/7326486.html

你可能感兴趣的文章
nodejs中安装webpack的简单使用
查看>>
array_combine php一个比较偏门的数组函数
查看>>
js数字转换为float,取N个小数
查看>>
lr参数化取值规则总结
查看>>
RN的第一个API-----注册组件Appregistry
查看>>
DevExpress Gridcontrol 显示序号列
查看>>
Delphi实现大写字母键打开提示
查看>>
SqlServer2008 数据库同步的两种方式 (发布、订阅)
查看>>
VS2010中,无法嵌入互操作类型“……”,请改用适用的接口的解决方法
查看>>
SpringBoot之springfox(Swagger) (ApiDoc接口文档)
查看>>
上手React Native--常用属性介绍
查看>>
Django 的认识,面试题
查看>>
TransactionScope 之分布式配置
查看>>
ExRichTextEdit.
查看>>
推荐些在线小制作小工具
查看>>
如何保障Go语言基础代码质量?
查看>>
c库和嵌入式开发 2011-08-24 10:50 392人阅读 评论(0) 收藏...
查看>>
api调用安全
查看>>
安卓下拉刷新和上拉加载的具体实例
查看>>
安卓资源
查看>>