Looking for some help to manipulate output data.
Here is my SQL
WITH SampleData (MAINJOB,JOB1,JOB2,JOB3,JOB4,JOB5,JOB6,JOB7,JOB8,JOB9,JOB10,JOB11) AS
SELECT 'DEF4061','DEF4062' ,'','','','','','','','','',''
ORDER BY 1
Current SQL output
MAINJOB JOB1 JOB2 JOB3 JOB4 JOB5 JOB6 JOB7 JOB8 JOB9 JOB10 JOB11
ABC4013 ABC4014 ABC4067 ABC4099 ABC4098 ABC4060 ABC4071
GHI4003 KLM4068 KLM4053 KLM4061 KLM4064 KLM4062 KLM4050 KLM4087 KLM462T KLM4085 KLM4011 KLM4076
In the desired output, I would like to return two columns only.
MainJob and MappedJob
In first record of each MainJob, we have main job and then in the mapped job main job again.
Second row for that main job would be, main job and Job1
Third row, main job and Job2 etc. as shown below.
Thank you in advance !