0

I'm trying to concatenate multiple rows of data into one row based off of another column's ordered value

Here's the data that I'm working with:

Here's the data picture

Here's the desired output:

37960 BRAKES GENERAL REPAIRS ADDITIONAL REPAIRS

I'm working in SSMS V14.0 Thanks!

11
  • So how do you know that these values belong together? What is the common identifier? Commented Aug 26, 2019 at 15:07
  • Don't post images of textual data. Images are useful for graphics, things that can't be communicated as text. Commented Aug 26, 2019 at 15:09
  • Updated with an image with an identifier column of data. Thanks Commented Aug 26, 2019 at 15:09
  • Hint: If you are using SQL-SERVER 2016 or before then FOR XML PATH. If using SQL-SERVER 2017 or later then STRING_AGG. Commented Aug 26, 2019 at 15:10
  • 1
    Do you have any column, through which you can group every set of 0, 1 and 2? Commented Aug 26, 2019 at 15:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.