web analytics

Oracle: transpose data table (rows into columns)

CREATE TABLE MAIN_TBL ( magazine VARCHAR2(10), region VARCHAR2(5), quantity int ); INSERT INTO MAIN_TBL VALUES ( ‘Playboy’,  ‘Nord’, 1 ); INSERT INTO MAIN_TBL VALUES ( ‘Playboy’,  ‘East’, 2 ); INSERT INTO MAIN_TBL VALUES ( ‘AutoWeek’, ‘Nord’, 3 ); INSERT INTO MAIN_TBL VALUES ( ‘AutoWeek’, ‘West’, 4 ); INSERT INTO MAIN_TBL VALUES ( ‘Wired’,    ‘Nord’, […]