SELECT * FROM (VALUES (x,y)) AS TableLiteral(Col1, Col2) 的名称 [英] Name for SELECT * FROM (VALUES (x,y)) AS TableLiteral(Col1, Col2)

查看:37
本文介绍了SELECT * FROM (VALUES (x,y)) AS TableLiteral(Col1, Col2) 的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是有效的 SQL 语法:

The following is valid SQL syntax:

SELECT *
    FROM (VALUES ('p','q'),('x','y')) AS TableLiteral(Col1, Col2)

并返回表:

  | Col1 | Col2
----------------
1 |  p   |  q
2 |  x   |  y

此语法可进一步用于 CTE 等.

This syntax can further be used in CTEs etc.

有这个名字吗?我一直称它们为TableLiterals",类比为字符串文字和正则表达式文字.

Is there a name for this? I've been calling them "TableLiterals" by analogy with string literals and regex literals.

是否有一个会被广泛认可的术语.

Is there a term that will be widely recognised.

推荐答案

它叫做:表值构造器

It is called: Table Value Constructor

指定要构造到表中的一组行值表达式.Transact-SQL 表值构造函数允许在单个 DML 语句中指定多行数据.可以在 INSERT 语句的 VALUES 子句、MERGE 语句的 USING 子句以及 FROM 子句中派生表的定义中指定表值构造函数.

Specifies a set of row value expressions to be constructed into a table. The Transact-SQL table value constructor allows multiple rows of data to be specified in a single DML statement. The table value constructor can be specified in the VALUES clause of the INSERT statement, in the USING clause of the MERGE statement, and in the definition of a derived table in the FROM clause.

值 ( ) [ ,...n ]

VALUES ( ) [ ,...n ]

有关 ANSI 标准的更多信息:F641,行和表构造函数选择不从

More info about ANSI standard: F641, Row and table constructors and select without from

这篇关于SELECT * FROM (VALUES (x,y)) AS TableLiteral(Col1, Col2) 的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆