Subject RE: [firebird-support] How to join multiple rows into a single string in FB?
Author Sasha Matijasic
>
> 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