DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: transpose columns into rows

  1. #1
    Join Date
    Sep 2001
    Location
    UK
    Posts
    45

    transpose columns into rows

    Hi ,

    I have to transpose columns into rows and Iam using the follg SQL

    select substr(x,begin,end-begin)
    from (select pos+1 begin,nvl(lead(pos) over (order by pos),length(x)+1) end
    from (select instr(x,',',1,rownum) pos
    from dba_objects)
    where rownum <= length(x)-length(replace(x,','))+1
    );

    Here x is a database function which has a value
    of '10,20,30,40'

    This function takes a lot of time to execute so can i use this function
    only once in the sql clause and substitute all further occurences of the function with it's value ?
    Internally I would like to substitue x with it's value since the string can be of any value

  2. #2
    Join Date
    Dec 2000
    Posts
    126
    search for pivot in asktom.oracle.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width