db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fernanda Pizzorno <Fernanda.Pizzo...@Sun.COM>
Subject Re: GROUP_BY with user functions
Date Mon, 18 Sep 2006 11:10:37 GMT
Have you tried this?

SELECT my_value
FROM
    (SELECT MY_USER_FUNCTION(t1.field1) AS my_value
     FROM T1) AS UserFunction
GROUP BY my_value

Regards,
- Fernanda


Robert Enyedi wrote:
> 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