How to merge Multiple Row As Single Row [closed]

I have a table emp has the following data:

taskid variablename answervalue fullvariablename
2081 ProratedOutput £1000 (One Thousand Pounds Sterling) for the period from 1 November 2018 to 31 December 2018 AutomaticHonorarium.REP_0
2081 ProratedOutput £4000 (Four Thousand Pounds Sterling) for the period from 1 January 2019 to 31 December 2019 AutomaticHonorarium.REP_1
2081 ProratedOutput £4000 (Four Thousand Pounds Sterling) for the period from 1 January 2019 to 31 December 2019 AutomaticHonorarium.REP_2
2081 ProratedOutput £4000 (Four Thousand Pounds Sterling) for the period from 1 January 2021 to 31 October 2021 AutomaticHonorarium.REP_3

I need the output as in single line with word ‘cont’ between answers

£1000 (One Thousand Pounds Sterling) for the period from 1 November 2018 to 31 December 2018 cont £4000 (Four Thousand Pounds Sterling) for the period from 1 January 2019 to 31 December 2019 cont £4000 (Four Thousand Pounds Sterling) for the period from 1 January 2020 to 31 December 2020 cont £4000 (Four Thousand Pounds Sterling) for the period from 1 January 2021 to 31 October 2021

  • Hi – your output appears to be four lines, not a single line. You need to show the SQL you’ve managed to write so far. Also, you haven’t actually asked a question (“I need…” is not a question) – what is the actual issue you are facing?

    – 

Leave a Comment