transform/ Pivot data in oracle [duplicate]

This question already has an answer here:

i want to transform data in Oracle

below is the data which i need to transform

   Name     Day v1 v2 v3 v4 
, Farrukh   07  1  2  3  4  
, Farrukh   08  0  0  0  0  
, Farrukh   09  0  8  7  9  
, Farrukh   10  0  0  9  9  
, user1     07  0  5  5  0  
, user1     08  0  9  1  0  
, user1     09  9  0  9  0  
, user1     10  0  0  0  0        

I want to tranfrom in below format

 Name     values  07 08 09 10
, Farrukh     v1    1  0  0  0  
, Farrukh     v2    2  0  8  0  
, Farrukh     v3    3  0  7  9  
, Farrukh     v4    4  0  0  9 
, user1       v1    0  0  9  0  
, user1       v2    5  9  0  0  
, user1       v3    5  1  9  0  
, user1       v4    0  0  0  0  

please some 1 help me how to achieve this using PL-SQL in ORACLE


Source: oracle

Leave a Reply