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: Serge Rielau <srielau_at_ca.ibm.com>
Date: Mon, 19 Sep 2005 07:54:17 -0400
Message-ID: <3p7n7dF8s75pU2@individual.net>


amogh wrote:

> 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 :-(
Take a look at "derived table" aka "inline view" in Oracle lingo.
>>
>>
>> -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
Didn't soemone say Postgress was compatible with Orcale? Hmm...

Cheers
Serge

-- 
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Received on Mon Sep 19 2005 - 06:54:17 CDT

Original text of this message

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