SELECT * FROM (VALUES (x,y)) 的名称 AS TableLiteral(Col1, Col2)
Name for SELECT * FROM (VALUES (x,y)) AS TableLiteral(Col1, Col2)
以下是有效的 SQL 语法:
SELECT *
FROM (VALUES ('p','q'),('x','y')) AS TableLiteral(Col1, Col2)
和returns table:
| Col1 | Col2
----------------
1 | p | q
2 | x | y
此语法可进一步用于 CTE 等。
这个有名字吗?
我一直通过类比字符串文字和正则表达式文字来称呼它们 "TableLiterals"。
有没有一个词会被广泛认可。
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.
VALUES ( ) [ ,...n ]
有关 ANSI 标准的更多信息:F641, Row and table constructors 和
select 没有来自
它们被称为Table值构造函数
https://docs.microsoft.com/en-us/sql/t-sql/queries/table-value-constructor-transact-sql
以下是有效的 SQL 语法:
SELECT *
FROM (VALUES ('p','q'),('x','y')) AS TableLiteral(Col1, Col2)
和returns table:
| Col1 | Col2
----------------
1 | p | q
2 | x | y
此语法可进一步用于 CTE 等。
这个有名字吗? 我一直通过类比字符串文字和正则表达式文字来称呼它们 "TableLiterals"。
有没有一个词会被广泛认可。
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.
VALUES ( ) [ ,...n ]
有关 ANSI 标准的更多信息:F641, Row and table constructors 和 select 没有来自
它们被称为Table值构造函数
https://docs.microsoft.com/en-us/sql/t-sql/queries/table-value-constructor-transact-sql