Bug #12544 LIMIT support for GROUP_CONCAT

Submitted: 12 Aug 2005 9:16 Modified: 19 Oct 2009 14:26
Reporter: Martin Jansen Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.x OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[12 Aug 2005 9:16] Martin Jansen
Description:
In some situations it would be handy to be able to specify a LIMIT clause for GROUP_CONCAT:  The following query on the "world" example database spits out a lot of cities for Australia, but there are certainly cases where one is only interested in the first n cities:

SELECT Country.Name, GROUP_CONCAT(City.Name) FROM City, Country WHERE Country.Continent = 'Oceania' AND Country.Code = City.CountryCode GROUP BY Country.Code;

Support for GROUP_CONCAT(... LIMIT n,m) would solve this problem very niftily.

How to repeat:
Run

SELECT Country.Name, GROUP_CONCAT(City.Name) FROM City, Country WHERE Country.Continent = 'Oceania' AND Country.Code = City.CountryCode GROUP BY Country.Code;

on the "world" example database.
[19 Oct 2009 14:26] Valeriy Kravchuk
Duplicate of Bug #30098.

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

Page generated in 0.049 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.