Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    83

    Unanswered: comma separated value

    Suppose I have a table like this

    code Value
    1 a
    1 a
    1 b
    2 c
    2 c
    1 d
    2 g


    Now my require ment that I want a distinct comma separated report about these data.Means for code 1 I need a comma separated distinct values.In this case it should be a,b,d
    My output should be like this
    1 a,b,d
    2 c,g
    Can anybody help me I can I do this with the help of a cursor or any other way?
    Subhasish

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: comma separated value

    Originally posted by subhasishray
    Suppose I have a table like this

    code Value
    1 a
    1 a
    1 b
    2 c
    2 c
    1 d
    2 g


    Now my require ment that I want a distinct comma separated report about these data.Means for code 1 I need a comma separated distinct values.In this case it should be a,b,d
    My output should be like this
    1 a,b,d
    2 c,g
    Can anybody help me I can I do this with the help of a cursor or any other way?
    Subhasish
    there is an article explaining exactly what u are looking for :
    http://www.sqlteam.com/item.asp?ItemID=256

    Regards,
    Harshal.

Posting Permissions

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