Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2014
    Posts
    1

    Unanswered: SQL query -Convert multiple rows in one row

    Hi all

    I'm trying to create SQL query

    But I can't convert multiple rows (collections) in one row

    I get following results:

    ps1 |serverDP

    ps1 |Adobe

    ps2 |CRT

    ps2 |Note

    but I need:


    ps1 |serverDP ,Adobe

    ps2 |CRT,Note


    Im using following query ....but it doesn't work .Need help!!!

    select

    v_FullCollectionMembership

    .Name as Name,

    CollName

    = stuff((SELECT '; ' + v_Collection.Name

    from

    v_Collection

    where

    v_Collection.CollectionID = v_FullCollectionMembership.CollectionID

    FOR

    XML PATH('')

    ), 1, 1,'')

    FROM v_FullCollectionMembership
    Last edited by Ckrim; 10-02-14 at 18:40.

Posting Permissions

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