• I think this a case for using 'FOR XML' to concatenate the last two columns,

    however we will need the table DDL and insert statements to create the data in the table

    plus more exact data for the last two columns, i.e. do AND / OR have leading/trailing spaces?

    and how do you determine the sequence of the last two columns?

    Far away is close at hand in the images of elsewhere.
    Anon.