Open firebird-automations opened 15 years ago
Commented by: Sean Leyne (seanleyne)
1 - since the LIST() syntax defines a delimiter_expr, I don't think that using a column falls into that syntax
2 - This is not what the LIST() is about, the delimiter_expr is a constant!!
Commented by: @dyemanov
Sean, you're wrong here. Starting with v2.5, LIST() is intended to support not only constants but virtually everything as its last argument. delimited_expr means a value expression and column is a perfectly valid expression (at least from the standard POV).
Commented by: Sérgio Alexandre Gianezini Júnior (sergioalexandre)
So, currently (2.1.3), List() can do something like this? Or will be only avaiable at 2.5+ versions?
Select CustomerCountry, List(CustomerName, Ascii_Char(13) || Ascii_Char(10)) CustomerList From Customers Group By CustomerCountry
I know that I can use this until 2.1.2 List(CustomerName || Ascii_Char(13) || Ascii_Char(10), '') CustomerList
But I get a extra carriage+linefeed at end of list...
Commented by: @asfernandes
Can't we consider the behaviour expected?
The delimiter is got from current record before concatenation of each expression.
Submitted by: Cosmin Apreutesei (cosmin_ap2)
test case:
select list(t.x, t.d) from ( select 'a' as x, ',' as d from rdb$database union all select 'b' as x, '.' as d from rdb$database union all select 'c' as x, ';' as d from rdb$database ) t