sql - Repeatedly combining multiple fields into one in Access -


i have huge table of 211 columns. have set of columns want "stack" one. i'm not @ explaining in words hope helps making clearer:

example:

column name: | c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | value      : | aa | bb | cc | aa | ee | dd | 11 | 22 | 

i want make table combining: c1 c4, c2 c5, c3 c6 , keeping c7 , c8 each rows. end result:

column name: | c1 | c2 | c3 | c7 | c8 | value      : | aa | bb | cc | 11 | 22 | value      : | aa | ee | dd | 11 | 22 | 

is there way of doing using sql commands? keep in mind simplified version of i'm trying accomplish, have combine 20 sets of 5 columns one.

thanks in advance!

that union query:

select c1 c1_c4, c2 c2_c5, c3 c3_c6, c7, c8 yourtable union select c4 c1_c4, c5 c2_c5, c6 c3_c6, c7, c8 yourtable 

Comments