jeganbenitto.francis (12/16/2013)
Can Anyone please help me in below requirementi have a row as below
1 AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH
I want the output as follows
AAAA BBBB CCCC DDDD
EEEE
FFFF
GGGG
HHHH
But i dont want to use UNPIVOT..
Thanks in advance
the tool to use is the unpivot operator.
if you don't want to use it, then you could try using a stack of unions:
your fake data obscure the real issue a lot, hopefully this points you in the right direction.
SELECT AAAA,BBBB,CCCC,DDDD As DDDD UNION ALL
SELECT AAAA,BBBB,CCCC,EEEE As DDDD UNION ALL
SELECT AAAA,BBBB,CCCC,FFFF As DDDD UNION ALL
SELECT AAAA,BBBB,CCCC,GGGG As DDDD UNION ALL
SELECT AAAA,BBBB,CCCC,HHHH As DDDD
Lowell