You seem lucky - Firebird 2.1 has a LIST() aggregate function that works like GROUP_CONCAT in MySql, which allows this query:
SELECT p.Name, LIST(c.Name, ', ') FROM parent p INNER JOIN child c on c.parentid = p.parentid GROUP by p.Name;
Change, reorder
You may be able to influence the ordering by first ordering the data in the view before applying the LIST aggregation function, for example:
SELECT x.ParentName, LIST(x.ChildName, ', ') FROM ( SELECT p.Name as ParentName, c.Name as ChildName FROM parent p INNER JOIN child c on c.parentid = p.parentid ORDER BY c.Name DESC ) x GROUP by x.ParentName;
Stuartlc
source share