Subject | Re: Sum (concat?) equivalent for Strings |
---|---|
Author | Adam |
Post date | 2005-09-16T01:56:17Z |
--- In firebird-support@yahoogroups.com, "Scott Buckham"
<scott_buckham@a...> wrote:
field1
A
B
then you could write a stored procedure to do the concatination
create procedure sp_blah
returns
(
outputstring varchar(500); -- make sure this is large enough
)
as
declare variable field1 varchar(10);
begin
outputstring = '';
for select field1 from tablea into :field1 do
begin
outputstring = :outputstring || :field1;
end
suspend; -- only if you use it as a selectable SP
end
^
So it is possible, but these transformations are generally much
easier on the client side.
Adam
<scott_buckham@a...> wrote:
> I'm looking for a function that will return me a concatenation ofable to
> Strings found across multiple rows. E.g like where you can use
> sum(NumericColumn) to return value 10 for rows 5,5 I want to be
> use functionX(StringColumn) to return "AB" for rows A,B.If you mean you have a single field with multiple rows
>
> Is this achievable?
field1
A
B
then you could write a stored procedure to do the concatination
create procedure sp_blah
returns
(
outputstring varchar(500); -- make sure this is large enough
)
as
declare variable field1 varchar(10);
begin
outputstring = '';
for select field1 from tablea into :field1 do
begin
outputstring = :outputstring || :field1;
end
suspend; -- only if you use it as a selectable SP
end
^
So it is possible, but these transformations are generally much
easier on the client side.
Adam