Oracle
 sql >> Base de données >  >> RDS >> Oracle

Oracle SQL pour convertir les lignes associées en une seule ligne

utiliser PIVOT

SELECT * FROM
(SELECT "RollNo", "Name", 
"Subject", "score" FROM Table1)  T
PIVOT
( max("score") for "Subject" in
   ('English' as English_score,
    'French'  as French_score,
    'Germany' as Germany_score,
    'Spanish' as Spanishh_score
    )
)