Re: convert access sql to postgresql

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Hart <tomhart(at)coopfed(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: convert access sql to postgresql
Date: 2007-11-16 23:12:57
Message-ID: 20071116231257.GF31271@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Nov 16, 2007 at 05:43:44PM -0500, Tom Hart wrote:
> I've been doing some googling on sql aliases (my sql knowledge is far
> from impressive) and it appears that column aliases can be great for
> displaying different column names in your output. However I was unable
> to find any information regarding using column aliases as variables,
> like in the code above. I'm not sure why this works in access, but does
> postgreSQL support using a column alias like a variable within the query
> that the alias was defined in?

IIRC this is not mentioned in the SQL standard. Not sure why, maybe the
theory is that all output columns are calculated simultenously which
can't be true if they refer to eachother.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
> -- John F Kennedy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2007-11-16 23:13:57 Re: Primary Key
Previous Message Martijn van Oosterhout 2007-11-16 23:06:30 Re: public schema doubt