Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Oracle SQL zum Konvertieren verwandter Zeilen in eine einzelne Zeile

Verwenden Sie 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
    )
)