Bug #71467 LIMIT clause in GROUP_CONCAT function

Submitted: 24 Jan 2014 7:22 Modified: 28 Jul 2014 10:32
Reporter: Eugene Eugene Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:5.X, 5.6, 5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: group_concat, limit

[24 Jan 2014 7:22] Eugene Eugene
Description:
Please implement a LIMIT clause for GROUP_CONCAT function.

How to repeat:
SELECT GROUP_CONCAT(some_field ORDER BY some_other_field DESC LIMIT 0,1 SEPARATOR '|') as first_occurence_of_sorted_entries_in_group FROM some_table

Suggested fix:
This is a workaround with not very best performance:
SELECT substring_index(GROUP_CONCAT(some_field ORDER BY some_other_field DESC SEPARATOR '|'), '|', 1) as first_occurence_of_sorted_entries_in_group FROM some_table
[28 Jul 2014 10:32] MySQL Verification Team
Hello!

Thank you for the feature request!

Thanks,
Umesh
[18 Aug 2016 5:36] MySQL Verification Team
Bug #82616 marked as duplicate of this

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.