db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Army <qoz...@gmail.com>
Subject Re: names of columns in VALUES
Date Wed, 30 Jan 2008 19:20:24 GMT
Jim Newsham wrote:
> 
> It seems there is no way to name the columns produced by the VALUES 
> keyword.

<snip>

> Select a, b, c from x, (values (“a”, “b”, “c”)) as y where x.a = y.1;

Two things with this statement:

   1. String literals should be enclosed in single quotes
   2. You can name the columns from the subquery using the AS clause..

So maybe try something like:

select a, b, c
   from x, (values ('a', 'b', 'c')) as y (y1,y2,y3)
   where x.a = y.y1

I did that locally and it seems to have worked...

ij> select a, b, c
   from x, (values ('a', 'b', 'c')) as y (y1,y2,y3)
   where x.a = y.y1;
A   |B   |C
--------------
a   |b   |c

1 row selected

Army


Mime
View raw message