Re: syntax for access an alias in the where clause ?

From: Michael Agbaglo <byteshifter(at)shifted-bytes(dot)de>
To: Wei Weng <wweng(at)kencast(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: syntax for access an alias in the where clause ?
Date: 2002-06-19 21:13:31
Message-ID: 3D10F3FB.6090706@shifted-bytes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Wei Weng wrote:

> Is it allowed to use spaces in postgresql alias?
>
> Why dont you try to use alias1 instead of "alias 1"?

really amusing... muhahaha...

I don't use the brackets either... I didn't assume that you might be
interested in how the expression looks like or what aliases I'm using...

>
>
> On Wed, 2002-06-19 at 14:03, Michael Agbaglo wrote:
>
>>Hi !
>>
>>It's long ago since I used SQL :-)
>>
>>select [expression 1] as [alias 1], [expression 2] as [alias 2]
>>where [alias 1] < [alias 2]
>>order by [alias 2] - [alias 1]
>>
>>---> ERROR: Attribute '[alias 1]' not found
>>
>>I found a lot of 'select [expression] as' but I've never seen somebody
>>accessing the alias ... Can't this be done ?
>>
>>M.
>>
>>
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>>
>>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-06-19 21:19:31 Re: Tagging rows into collections?
Previous Message afa 2002-06-19 20:45:25 Assign values to array