Re: SELECT 1st field - Mailing list pgsql-sql

From Misa Simic
Subject Re: SELECT 1st field
Date
Msg-id CAH3i69kQiOwUsYpfu6aq9F3ZqG6jr5tN8fr-CPZydTsKnG9b4Q@mail.gmail.com
Whole thread Raw
In response to Re: SELECT 1st field  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SELECT 1st field  (Jan Bakuwel <jan.bakuwel@greenpeace.org>)
List pgsql-sql
Both works fine:

SELECT generate_series AS id FROM generate_series(1,5);

and

SELECT id FROM generate_series(1,5) AS foo(id);

Technically dont know is there any differenece...

Thanks,

Misa

2012/5/15 Tom Lane <tgl@sss.pgh.pa.us>
Jan Bakuwel <jan.bakuwel@greenpeace.org> writes:
> What I need is the ability to name the column in the view, ie.

> create view v as select 1 as "id" from func(5);

I think what you're looking for is the ability to re-alias a column name,
for example

       select id from func(5) as foo(id);

                       regards, tom lane

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: SELECT 1st field
Next
From: Wes James
Date:
Subject: Re: order by different on mac vs linux