Merging the rows

  • The Output result set is coming as

    Column

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

    a-1 (row 1)

    b-91e25b15-(row 2)

    c-66364531(row 3)

    expected output required(all rows needs to merged into single row)

    a-1 b-91e25b15 c-66364531(row 1)

  • try this

    declare @sql varchar(max)

    select @sql=coalesce(@sql,'')+columnname

    from

    tablename

    select @sql

  • Thank you

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

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