-
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|