Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Referencing function result inside GROUP BY?

Re: Referencing function result inside GROUP BY?

From: amogh <amogh.r_at_gmail.com>
Date: Mon, 19 Sep 2005 14:37:31 +0530
Message-ID: <SsvXe.6$V1.53@news.oracle.com>


Vjeran Marcinko wrote:
> Hi.
>
> Is there some way to avoid redudancy inside SQL queries like :
>
> SELECT someFunction(t.column) FROM Table t GROUP BY someFunction(t.column)
>
> with something like:
>
> SELECT someFunction(t.column) AS result FROM Table t GROUP BY result
>
> Later gives me "invalid column name: result" error :-(
>
>
> -Vjeran
>
>

I think column aliases can be referenced only in the ORDER BY clause but not in a GROUP BY.I read somewhere that ssing aliases in GROUP BY is a violation of the SQL92 standard..

PS: FYI, This is possible in PgreSQL though

Amogh Received on Mon Sep 19 2005 - 04:07:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US