I need to pivot a table as follows : the initial table is like this
GEO PRD PACK    DATATYPE    Sales1  Sales2
T1  P1  M1  22          1     2
T1  P1  M1  23          2     8
T1  P1  M1  24          3     5
T2  P2  M2  22          3     2
T2  P2  M2  23          1     4
T2  P2  M2  24          1     7
and what I want is :
GEO PRD PACK 22_Sales1 22_Sales2 23_Sales1 23_Sales2 24_Sales1 24_Sales2
T1  P1  M1       1         2         2         8         3         5
T2  P2  M2       3         2         1         4         1         7
here, the distinct DATATYPE is fixed : always will be : 22, 23, 24, no less and no more.
Please, can anyone help me how to write the proper query ?
 
     
     
     
    