Doubt in adding group by+all record?

Discussion in 'MySQL' started by vetrivel, Apr 8, 2009.

  1. #1
    Hi,
    I would like to write a mysql query to select all the records from a table Which is grouped by one field but all records of another field.

    Say for example I have a table(RECORD) like this:
    amount |name
    1|jack
    2|rose
    3|king
    2|queen


    I need to group by "amount "
    but all records of "name"
    I need the result like this
    1|jack
    2|rose,queen
    3|king
    How to do this?
    Please HELP....
     
    vetrivel, Apr 8, 2009 IP
  2. vetrivel

    vetrivel Peon

    Messages:
    147
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ???????????
    anybody
     
    vetrivel, Apr 19, 2009 IP
  3. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #3
    Try GROUP_CONCAT with separator ','

    Regards
     
    koko5, Apr 19, 2009 IP