If you have mysql 4.1, you can use GROUP_CONCAT().

  SELECT id, GROUP_CONCAT(f2) FROM yourtable GROUP BY id;

See the manual for details <http://dev.mysql.com/doc/mysql/en/GROUP-BY-Functions.html>.

Michael

Feghhi, Jalil wrote:

Is there a way to convert the following result set:

id              f2
---             ---
1               b
1               c

to:

id              f2
--              --
1               b,c

Using a select or any other functions? Basically, I want to put f2 fields together 
when ids are the same.

Thanks,

-Jalil


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to