From: Paul Halliday Date: March 28 2012 12:58am Subject: Re: Group expansion as part of the result List-Archive: http://lists.mysql.com/mysql/227064 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Mar 27, 2012 at 3:43 PM, Dan Nelson wrote= : > In the last episode (Mar 27), Paul Halliday said: >> Say I have: >> >> SELECT COUNT(name), name, COUNT(DISTINCT(status)) FROM table GROUP BY na= me >> >> and it returns: >> >> 20 paul 5 >> 19 john 2 >> 75 mark 3 >> >> is there a way to return what comprises =A0DISTINCT(status) as part of t= he result? >> >> so: >> >> 20 paul 2,3,1,20,9 >> 19 john 20,9 >> 75 mark 1,20,9 > > You want GROUP_CONCAT: > Heh, and exactly how I wanted it formatted. Great! Thanks. --=20 Paul Halliday http://www.squertproject.org/