View Full Version : crosstab? or laying down the table


kenan
05-30-2008, 06:45 AM
i am not sure how this is called , i have a multidimentional (multicolomned) table. I want to turn this into single dimentional ( that have only one value colomn ) table

i have this table

A B C
AA 1 5 3
BB 5 1 7
CC 2 5 6

i want to turn this into that

AA A 1
BB A 5
CC A 3
AA B 5
BB B 1
CC B 7



the table is 17,000 rows long at the firt case and it must be 1.8 million rows. So excel is no help.
i am trying to find a solution for 2 days for no avail.
Any help?
thanks in advance
by the way i am new here , hi to all

EDİT : sorry for the bad shape of tabls, i am behind corporate firewall , cant use image hosting .

kenan
06-02-2008, 02:00 AM
i still cannot solve the problem.
sorry for any wording mistake , i am not a native english speaker
any help!!

kenan
06-02-2008, 03:27 AM
please !!!!

georgedwilkinson
06-02-2008, 07:06 AM
This is not a crosstab.

Try this:
select FirstColumn, A from MyTable
union all
select FirstColumn, B from MyTable
union all
select FirstColumn, C from MyTable;

kenan
06-03-2008, 07:11 AM
thank you
at first when i added 108 columns i get "querry is too complex" error
then i divided into 3x27 union all querries , then turned all three into one table with a make table querry
that is the first time i write an sql querry