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

wrong order in LIST() function when group by distinct [CORE4146] #4473

Closed
firebird-automations opened this issue Jul 24, 2013 · 6 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Nick Dirov (dnn)

select distinct f1, list(f2)
from
(select f1, f2
from
(select 1 as f1, 'a' as f2 from rdb$database
union
select 2 as f1, 'b' as f2 from rdb$database
union
select 2 as f1, 'c' as f2 from rdb$database
union
select 3 as f1, 'e' as f2 from rdb$database)
order by 1, 2 desc)
group by 1

return
1- a
2- b,c
3- e

instead of expected
1- a
2- c,b
^^^^
3- e

so as we watch order by clause ignored when group by distinct ..

====== Test Details ======

No sense in test because LIST function does not guarantee any particular order.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

The order of items in LIST are undefined, see http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-aggrfunc-list.html (last item in list)

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

LIST function does not guarantee any particular order, regardless of the inner ORDER BY clauses. This ticket will be closed in favor of already existing CORE2676 and CORE2332.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Test Details: No sense in test because LIST function does not guarantee any particular order.

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