Re: SELECT 1st field

Поиск
Список
Период
Сортировка
От Misa Simic
Тема Re: SELECT 1st field
Дата
Msg-id CAH3i69kQiOwUsYpfu6aq9F3ZqG6jr5tN8fr-CPZydTsKnG9b4Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SELECT 1st field  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: SELECT 1st field  (Jan Bakuwel <jan.bakuwel@greenpeace.org>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SELECT 1st field
Следующее
От: Wes James
Дата:
Сообщение: Re: order by different on mac vs linux