Not sure what you mean by the case where you are using VALUES to construct a table,  Derby does allow naming those columns.

ij> values (1,1,1), (2,2,2);
1          |2          |3
-----------------------------------
1          |1          |1
2          |2          |2
ij> select * from (values (1,1,1), (2,2,2)) as t(i,j,k) order by i desc;
I          |J          |K
-----------------------------------
2          |2          |2
1          |1          |1

Aren't these symantically the same?

Satheesh

Jeremy Boynes wrote:
Yes they should. Unfortunately that is not always possible and I think the case where you are using VALUES to construct a table is one of those. In other words, Tomohito's test is reliant on implementation dependent behaviour.

The spec does say that alias names are generated and so it should be possible to reference them even if doing so is non-portable. Personally I would prefer the <SQLCol1> form because it is at least a legal identifier; using <1> would mean having to quote the reference which seems inconvenient and confusing e.g. ORDER BY "1"

Whatever the outcome I do think we need to document how the names are generated so a user can figure it out.

--
Jeremy

Reply via email to