Subject Re: [firebird-support] How to join multiple rows into a single string in FB?
Author Zd
I see, thank you!

And how fast would the stored procedure version be?

Would that be usable?

Thanks:
Zd

----- Original Message -----
From: Sasha Matijasic
To: firebird-support@yahoogroups.com
Sent: Sunday, February 24, 2008 9:59 PM
Subject: RE: [firebird-support] How to join multiple rows into a single string in FB?


>
> How do I write an SQL for this? So the result of the query should be
> like:
> NameID1, Name1, 'MemberName1, MemberName2, MemberName3, etc.'
> NameID2, Name2, 'MemberName4, MemberName5, etc.'
> ...
>

At the moment, you can achieve the desired result with selectable stored procedure but there is no way you do that in sql.

FB 2.1 will introduce list aggregate function that will do exatcly what you want, something like this:

select nameid, min(name), list(membername)
from names
left join members on members.nameid = names.nameid
group by nameid

Sasha





[Non-text portions of this message have been removed]