dynamobi/dynamobi — Issue #744: [FRG-127] allow columns to be renamed in table alias, per SQL:2003
Author: dynamobi-build
Created: 2011-12-30 03:46:33+00:00
State: open
Labels: FRG, SQL Validator

[reporter="jhyde", created="Wed, 10 May 2006 01:08:22 -0500 (GMT-05:00)"]
SQL:2003 allows AS to be followed by a column list, for example

SELECT * FROM (VALUES (1, 'a'), (2, 'b')) AS t (x, y)

The column list isn't usually much use, but it's important with the VALUES clause, which otherwise columns with unpredictable names. Otherwise you'd have to write

SELECT 1 AS x, 'a' AS y FROM (VALUES (true))

UNION ALL

SELECT 2 AS x, 'b' AS y FROM (VALUES (true))

Also note that this syntax is required to support Mondrian's feature.