All Forums Database
BPP 24 posts Joined 01/10
20 Aug 2015
Unpack column values

Hello, any one has solution for this? is there unpack udf with anyone and willing to share?
Problem:-
Column values:  abcd, 1234, 3456, 34656,......, nnnn
Desired Output:
col1     col2        col3              col4               coln
abcd    1234      3456            34656            nnnn
Unpivoted results are also fine.. 
Like
col
abcd
1234
...
nnnn
 
Currently doing this with standard sql functions (comb of len, substr, case etc ) and it is very slow.. let me know, thanks in advance for your time.
 

BPP
saravanatn 10 posts Joined 07/11
15 Sep 2015

Hi,
I Guess your requirement is to convert ROWS into COLUMNS. Is it right?
If so then below is the query:
 
sel col1 from pack.table
union
sel col2 from pack.table
 
 

You must sign in to leave a comment.