how to use CTE or subquery in sql

May 8 2019 11:50 PM
Hi,
 
here is my sql table...
 
 
I want output somthing like this...
 
 
How to do this using sql join or CTE or subquery.
can any one help me to solve this query? 

Answers (5)