How to Transpose

  • and one know how to transpose is SQL easily?

    table looks like this

    {Name}

    john

    joe

    fred

    william

    ------------------

    need result set to look like this...

    john,joe,fred,william

     

     

  • SQL 2005 has PIVOT and UNPIVOT statements

    In SQL 2000 use Case or IF

    Regards,Yelena Varsha

  • DECLARE @NameList VARCHAR(255)
    SELECT @NameList = COALESCE(@NameList + ',', '') + Name
    FROM tblName
    PRINT @NameList
    







    **ASCII stupid question, get a stupid ANSI !!!**

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

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