How to implement the single-row subtotal of Oracle PIVOT row transfer columns?

1, data preparation

CREATE  TABLE [StudentScores]
(
   [UserName]         NVARCHAR(20),        --
   [Subject]          NVARCHAR(30),        --
   [Score]            FLOAT,               --
)

INSERT INTO [StudentScores] SELECT "", "", 80
INSERT INTO [StudentScores] SELECT "", "", 90
INSERT INTO [StudentScores] SELECT "", "", 70
INSERT INTO [StudentScores] SELECT "", "", 85
INSERT INTO [StudentScores] SELECT "", "", 80
INSERT INTO [StudentScores] SELECT "", "", 92
INSERT INTO [StudentScores] SELECT "", "", 76
INSERT INTO [StudentScores] SELECT "", "", 88
INSERT INTO [StudentScores] SELECT "", "", 60
INSERT INTO [StudentScores] SELECT "", "", 82
INSERT INTO [StudentScores] SELECT "", "", 96
INSERT INTO [StudentScores] SELECT "", "", 78

query result:
clipboard.png

sql


:

clipboard.png

:

clipboard.png

Mar.29,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ba18-e7fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ba18-e7fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?