SQL query for making the horizontally stored data to vertical format
694068Jun 30 2009 — edited Jun 30 2009HI i have a table named table1 and columns and data as below like below
table1
Main sub1 sub2 sub3 sub4 sub5 sub6
A L1 T1
B L1 T1
C L2 T2 K1 T1
D L2 T2 K1 T1
Basically the data is stored in horizontal above.i want a query to make the data in vertical like below
A T1
A L1
B T1
B L1
C T1
C K1
C T2
C L2
D T1
D K1
D T2
D L2
Aslo even if the values come in sub5 and sub6 the query should handle and populate the values vertically and also if a new row added also.
Thanks a lot in advance