Oracle
 sql >> Database >  >> RDS >> Oracle

Oracle SQL per convertire le righe correlate in una singola riga

usa 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
    )
)