You can make use of Pivot function in SQL server:
SELECT * FROM TABLE1
PIVOT(MIN(QTY) FOR [YEAR] IN ([2017], [2018], [2019], [2020])) PIVOT_TABLE;
solved Pivot Data on A SQL WITH Query
You can make use of Pivot function in SQL server:
SELECT * FROM TABLE1
PIVOT(MIN(QTY) FOR [YEAR] IN ([2017], [2018], [2019], [2020])) PIVOT_TABLE;
solved Pivot Data on A SQL WITH Query