请帮助解决此SQL查询问题。
表1:
Date Name Age Marks Subject
2019-05-01 Monoj 27 90 English
2019-05-02 Jone 39 89 Physics
2019-05-03 Stephen 69 80 History
2019-05-04 Neha 25 60 Chemistry
2019-05-05 Ripon 22 99 Math
2019-05-06 Debashis 23 100 English
我想看下面的输出:
Column 2019-05-01 2019-05-02 2019-05-03 2019-05-04 2019-05-05 2019-05-06
Name Monoj Jone Stephen Neha Ripon Debashis
Age 27 39 69 25 22 23
Marks 90 89 80 60 99 100
Subject English Physics History Chemistry Math English
SELECT 'Name' AS Name,
[2019-05-01], [2019-05-02], [2019-05-03], [2019-05-04], [2019-05-05],[2019-05-06]
FROM
(SELECT Name, Age, Marks,Subject
FROM Table1) AS SourceTable
PIVOT
(
AVG(Marks)
FOR Name IN ([2019-05-01], [2019-05-02], [2019-05-03], [2019-05-04], [2019-05-05],[2019-05-06])
) AS PivotTable