Data format

  • I have the following data.

    Number Name

    1 xxx

    1 yyy

    2 xxx

    2 zzz

    3 xxx

    3 yyy

    3 lll

    1 lll

    1 mmm

    2 nnn

    I need to displey this data as

    number name

    1 xxx,yyy,lll,mmm

    2 xxx,zzz,nnn

    3 xxx,yyy,lll

    Thanks.

  • You could use the FOR XML PATH string concatenation.

    For a list of examples, please search this site for "string concatenation xml".

    Side note: with 90 visits I'd expect you did run across the frequent reply when asking questions in the format you did: Please provide ready to use sample data as described in the first link in my signature.

    Therefore, I decided to point you to some search key words instead of providing a coded and tested solution...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply