| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Column aggregating for text columns
> Quite clever way to solve it. However, if one could define aggregate
> functions the solution would have been slightly less complicated :-)
> I'm thinking something like:
>
> select id, my_concat(name) from test group by id
It works for me. I may be dumb (Joe Celko thinks so, atleast), but I believe a row aggregate function for summing and multiplying (PRODUCT) should have been included long ago in the SQL standard.
The one modification I would do to your suggestion is adding the maxlength or precision as a parameter to the aggregating function. something like -
concat (name, 300) or
product (salary, 15.2)
>
> I raised the question some time ago, and Kieran mentioned that
> Informix and Postgres have an CREATE AGGREGATE command for this. There
> is also a discussion about how to calculate PRODUCT (which also is
> fairly complicated to express without an aggregate function) in there.
> If you use google you can find the thread by searching for
> lennart_at_kommunicera.umea.se and "user defined column functions"
That would work too, but it leaves the programmers at the mercy of the vendors, as each vendor would foist their own syntax/language as is the case for the stored procedures.
I read the thread you have suggested. Thanks. Received on Fri May 24 2002 - 20:26:24 CDT
![]() |
![]() |