Hi,
I've this table ANSWER (with more 30 column answers)
EMP_ID.....DIVISION.....CI
TY......AN
SWER1.....
ANSWER2...
..ANSWER3.
....ANSWER
4......ANS
WER5
001.........AAAA.......LON
DON......0
..........
.1........
....30....
..........
........0
033.........BBBB.......ROM
E......0..
.........0
..........
..30......
......20..
........90
222.........CCCC.......BOS
TON......0
..........
..........
...30.....
..........
........
555.........DDDD.......CHI
CAGO......
0.........
..1.......
.....60...
.......10.
........60
666.........EEEE.......NEW
YORK......0...........1...
.........5
0.........
...0......
...50
..........................
..........
..........
..........
..........
..........
..........
..
..........................
..........
..........
..........
..........
..........
..........
..
more 1000 records
I'd like to write one query with each column answer into multiple rows like this:
EMP_ID....DIVISION....CITY
.......ANS
WER
001........AAAA.......LOND
ON.......0
001........AAAA.......LOND
ON.......1
001........AAAA.......LOND
ON.......3
0
001........AAAA.......LOND
ON........
.
001........AAAA.......LOND
ON.......0
033........BBBB.......ROME
.......0
033........BBBB.......ROME
.......0
033........BBBB.......ROME
.......30
033........BBBB.......ROME
.......20
033........BBBB.......ROME
.......90
222........CCCC.......BOST
ON.......0
222........CCCC.......BOST
ON.......
222........CCCC.......BOST
ON.......3
0
222........CCCC.......BOST
ON........
.
222........CCCC.......BOST
ON.......
555........DDDD.......CHIC
AGO.......
0
555........DDDD.......CHIC
AGO.......
1
555........DDDD.......CHIC
AGO.......
60
555........DDDD.......CHIC
AGO.......
10
555........DDDD.......CHIC
AGO.......
60
001........AAAA.......NEW YORK.......0
001........AAAA.......NEW YORK.......1
001........AAAA.......NEW YORK.......50
001........AAAA.......NEW YORK.........0
001........AAAA.......NEW YORK.......50
..........................
........
..........................
........
..........................
........
How can I write my query to get this output?
Thanks in advance!