Re: SELECT 1st field

From: Misa Simic <misa(dot)simic(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Bakuwel <jan(dot)bakuwel(at)greenpeace(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT 1st field
Date: 2012-05-15 12:21:56
Message-ID: CAH3i69kQiOwUsYpfu6aq9F3ZqG6jr5tN8fr-CPZydTsKnG9b4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us>

> Jan Bakuwel <jan(dot)bakuwel(at)greenpeace(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Wes James 2012-05-15 14:20:52 Re: order by different on mac vs linux
Previous Message Tom Lane 2012-05-15 11:01:04 Re: SELECT 1st field