Is there a SQL funtion to concatenate a column from several rows into 1 string?

  • Is there a SQL funtion to concatenate a column from several rows into 1 string? Do I need to build my own?

    <><
    Livin' down on the cube farm. Left, left, then a right.

  • Not a pre-defined function, but there are several methods to achieve your requirement.

    Concatenating Row Values in Transact-SQL[/url]

    The XML one is my favorite.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Thanks. There are some interesting options.

    <><
    Livin' down on the cube farm. Left, left, then a right.

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

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