Skip site navigation (1) Skip section navigation (2)

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: (view raw or whole thread)
Lists: pgsql-sql
Both works fine:

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


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

Technically dont know is there any differenece...



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:

In response to


pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group