I get a output as shown in below table from my query as 

![enter image description here](https://i.stack.imgur.com/GRHK5.jpg)

Now I need my output should something like below table

![enter image description here](https://i.stack.imgur.com/OlfOV.jpg)

It will merge the common fields of multiple rows into one cell.

How can I write a query to do this?