Advanced Search

Results 1 to 2 of 2

Thread: stored procedure using while loop.

  1. #1
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default stored procedure using while loop.

    Hi experts hope every one is doing well.

    please help me write stored procedure
    I have 2 columns
    num name
    1 john
    1 jessy
    1 Glen
    2 Jennifer
    2 Michael
    3 Paul
    3 Mike

    the output I require should be in the format:
    tabel name: abc

    num Name
    1 john,jessy,Glen
    2 Jennifer, Michael
    3 Paul, Mike

    I have written a select statement using group_concat operator and it ha given me the exact output which I require.

    select num , group_concat(name) from abc group by num;

    But I need to write a stored procedure for this which shoud give the same result. Which means I should compare each row with another.

    please suggest me how can it be achieved.

  2. #2
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    some one please help me .. as am new to mysql and to this forum as well....

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •