Does anyone know if Firebird 2.5 has a function similar to the "STUFF" function in SQL? I have a table which contains parent user records, and another table which contains child user records related to the parent. I'd like to be able to pull a comma delimited string of the "ROLES" the user has without having to use a second query, loop over the values returned for the given ID and create the string myself.
I've searched for any other related questions, but have not found any. The question in this link string equivalent of Sum to concatenate is basically what I want to do too, but with the Firebird 2.5 database.
It looks like you are in luck - Firebird 2.1 has a
LIST()
aggregate function which works likeGROUP_CONCAT
in MySql, which allows a query like so:Edit, re Ordering
You may be able to influence ordering by pre-ordering the data in a derived table, prior to applying the
LIST
aggregation function, like so: