hi

search in asktom.oracle.com

there are 4 or 5 threads about pivoting queries