db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Re: GROUP_BY with user functions
Date Mon, 18 Sep 2006 09:37:38 GMT
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