Subject | Re: [firebird-support] Aggregation by concatenation |
---|---|
Author | Arno Brinkman |
Post date | 2004-10-27T13:34:28Z |
Hi,
TableA - FieldA
FieldA
--------
A12345
B12345
C12345
SELECT SUM(FielA) FROM TableA
SUM
------
A12345B12345C12345
There are many problems with this.
1) What is the output datatype for the SUM (this needs to be known at
prepare time)?
2) I do this on 1.000 records with a average of 500 characters per record?
I would say, write a SP :-)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info
> I had an idea of a new feature which I think could be useful, pleaseYou meant :
> tell me what you think. Currently, it's possible to aggregate a column
> as a sum, an average, an minimum or a maximum. It would be useful, in
> certain cirsumstances, to be able to aggregate a column by concatenating
> all the values, or perhaps by putting them all into an array.
>
> ...?
TableA - FieldA
FieldA
--------
A12345
B12345
C12345
SELECT SUM(FielA) FROM TableA
SUM
------
A12345B12345C12345
There are many problems with this.
1) What is the output datatype for the SUM (this needs to be known at
prepare time)?
2) I do this on 1.000 records with a average of 500 characters per record?
I would say, write a SP :-)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info