Pivot tables

select student,subject,grade from base_table;

                    student subject    grade
                    ------- ---------- -----
                    Fred    reading    A
                    Fred    writing    B
                    Fred    arithmetic C
                    Mary    reading    B
                    Mary    writing    B
                    Mary    arithmetic C

                     /* -->> PIVOT -->> */

select * from pivot_table;

                    student reading writing arithmetic
                    ------- ------- ------- ----------
                    Fred    A       B       C
                    Mary    B       B       C