All Forums General
anilbabu143 1 post Joined 06/12
12 Jun 2012
recursive query

suppose the result of the query  is like

a

a

a

i need the result in the a a a

 

i tried with the recursive query but i am not able get that.can any one help me to resolve this

 

thanks in advance

 

naveen kumar 1 post Joined 07/12
08 Jul 2012

Hi,

the below solution is very specific to the query mentioned above and is not generic for tansposing.

suppose you have data like this SEL * FROM tduser.test

a
a
a
 

SEL
MAX(col1),
MAX(col2),
MAX(col3)
FROM
(
SEL
col1,
' ',
' '
FROM
tduser.test
UNION ALL
SEL
' ',
col1,
' '
FROM
tduser.test
UNION ALL
SEL
' ',
' ',
col1
FROM
tduser.test
) abc (col1,col2,col3)

Result set

    Maximum(col1)    Maximum(col2)    Maximum(col3)
    a                                  a                           a
 

Thanks

Naveen Kumar

 

You must sign in to leave a comment.