I have written one query in SQL. I can't get correct output.

here I have attached screenshot. 

This is query Output

![This is query Output](https://i.stack.imgur.com/5s1oQ.png) 

but I want it like this 

![Image](https://i.stack.imgur.com/nu0KD.png)