Jim Newsham wrote:

It seems there is no way to name the columns produced by the VALUES keyword.

http://db.apache.org/derby/docs/dev/ref/rreftableexpression.html#rreftableexpression

ij> select * from (values ('aaaaaaaaaa', 'bbbbbbbbb')) AS T(MYCOL,MYOTHERCOL);
MYCOL     |MYOTHERC&
--------------------
aaaaaaaaaa|bbbbbbbbb

1 row selected

On a slightly related note, for orthogonality it would also be useful to be able to produce a resultset with a finite number of columns but zero records, using the VALUES keyword. For hand-written sql, this might be useless, but for some of the auto-generated sql I produce, it would save some special casing and code contortion. But this one is minor… the renaming would be much more helpful.

select * from (values ('aaaaaaaaaa', 'bbbbbbbbb')) AS T(MYCOL,MYOTHERCOL) where 1 = 0;

HTH,
Dan.

Reply via email to