I've got a rather big pickle of a problem that's left me stumped. I have a giant database of some 40,000+ rows, each detailing a company. Columns in this database include employment by year (columned Emp90, Emp91, etc.), as well as sales (Sales90, Sales91, etc.). The data currently looks like this:
Company Emp90 Emp91 Emp 92...Sales90 Sales91 Sales92...Sales07
1 5 7 9 200 205 209 300
2 6 8 10 200 205 209 300
3 7 9 11 200 205 209 300
4 8 10 12 200 205 209 300
5 9 11 13 200 205 209 300
What I want it to look like is something like this:
Company Year Emp Sales
1 1990 5 200
1 1991 7 205
1 1992 9 209
1 1993 11 214
1 1994 13 230
...
2 1990 6 200
Etc.
Is there any set of SQL code or some query-procedure I could go through to reorder the data? Because the dataset is so large, I can't simply convert it to Excel.
Thanks!!!
Company Emp90 Emp91 Emp 92...Sales90 Sales91 Sales92...Sales07
1 5 7 9 200 205 209 300
2 6 8 10 200 205 209 300
3 7 9 11 200 205 209 300
4 8 10 12 200 205 209 300
5 9 11 13 200 205 209 300
What I want it to look like is something like this:
Company Year Emp Sales
1 1990 5 200
1 1991 7 205
1 1992 9 209
1 1993 11 214
1 1994 13 230
...
2 1990 6 200
Etc.
Is there any set of SQL code or some query-procedure I could go through to reorder the data? Because the dataset is so large, I can't simply convert it to Excel.
Thanks!!!