Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIST(column, delimiter_expr) should require any column references in delimiter_expr be in ithe GROUP-BY clause [CORE2443] #2857

Open
firebird-automations opened this issue Apr 28, 2009 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

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

@firebird-automations
Copy link
Collaborator Author

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!!

@firebird-automations
Copy link
Collaborator Author

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).

@firebird-automations
Copy link
Collaborator Author

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...

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Can't we consider the behaviour expected?

The delimiter is got from current record before concatenation of each expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant