I have to transpose columns into rows and Iam using the follg SQL
from (select pos+1 begin,nvl(lead(pos) over (order by pos),length(x)+1) end
from (select instr(x,',',1,rownum) pos
where rownum <= length(x)-length(replace(x,','))+1
Here x is a database function which has a value
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