db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Enyedi <robert.eny...@intland.com>
Subject Re: GROUP_BY with user functions
Date Mon, 18 Sep 2006 10:38:45 GMT
Thanks for the tip. I tried this, but it has the same problem with alias 
referencing.

Regards,
Robert

Øystein Grøvlen wrote:
> Robert Enyedi wrote:
>
>> If I need to group the values returned by the MY_USER_FUNCTION, I 
>> simply cannot do so because the following query is invalid in Derby:
>>
>> SELECT MY_USER_FUNCTION(t1.field1) AS MY_VALUE
>> FROM T1
>> GROUP BY MY_VALUE
>>
>
> I have not tried this, but maybe something like this will work:
>
> SELECT UserFunction.value AS my_value
> FROM
>     (SELECT MY_USER_FUNCTION(t1.field1) AS value
>      FROM T1) AS UserFunction
> GROUP BY my_value
>
> -- 
> Øystein
>


Mime
View raw message