SELECT TO_DATE('20140401080000','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 67 T4, '8007042 ' T5, 68 T6, '1840038900' T7, 12 T8, 0 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080008','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 68 T4, '1840038900' T5, 69 T6, '8002734 ' T7, 8 T8, 2 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080101','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 69 T4, '8002734 ' T5, 70 T6, '1840038800' T7, 45 T8, 5 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080333','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 70 T4, '1840038800' T5, 71 T6, '8001929 ' T7, 152 T8, 6 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080443','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 71 T4, '8001929 ' T5, 72 T6, '1840038400' T7, 31 T8, 1 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080535','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 72 T4, '1840038400' T5, 73 T6, '8002433 ' T7, 52 T8, 0 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080611','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 73 T4, '8002433 ' T5, 74 T6, '1840051400' T7, 3 T8, 0 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080816','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 74 T4, '1840051400' T5, 75 T6, '8002432 ' T7, 125 T8, 2 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080901','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 75 T4, '8002432 ' T5, 76 T6, '1840051300' T7, 23 T8, 5 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080908','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 76 T4, '1840051300' T5, 77 T6, '1840051200' T7, 7 T8, 2 T9 FROM DUAL
UNION ALL SELECT TO_DATE('20140401080929','YYYYMMDDHH24MISS') T1, '30300100' T2, '130752344' T3, 77 T4, '1840051200' T5, 78 T6, '8001715 ' T7, 21 T8, 6 T9 FROM DUAL
;
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
T7 |
T8 |
T9 |
2014/04/01 08:00:00 |
30300100 |
130752344 |
67 |
8007042 |
68 |
1840038900 |
12 |
0 |
2014/04/01 08:00:08 |
30300100 |
130752344 |
68 |
1840038900 |
69 |
8002734 |
8 |
2 |
2014/04/01 08:01:01 |
30300100 |
130752344 |
69 |
8002734 |
70 |
1840038800 |
45 |
5 |
2014/04/01 08:03:33 |
30300100 |
130752344 |
70 |
1840038800 |
71 |
8001929 |
152 |
6 |
2014/04/01 08:04:43 |
30300100 |
130752344 |
71 |
8001929 |
72 |
1840038400 |
31 |
1 |
2014/04/01 08:05:35 |
30300100 |
130752344 |
72 |
1840038400 |
73 |
8002433 |
52 |
0 |
2014/04/01 08:06:11 |
30300100 |
130752344 |
73 |
8002433 |
74 |
1840051400 |
3 |
0 |
2014/04/01 08:08:16 |
30300100 |
130752344 |
74 |
1840051400 |
75 |
8002432 |
125 |
2 |
2014/04/01 08:09:01 |
30300100 |
130752344 |
75 |
8002432 |
76 |
1840051300 |
23 |
5 |
2014/04/01 08:09:08 |
30300100 |
130752344 |
76 |
1840051300 |
77 |
1840051200 |
7 |
2 |
2014/04/01 08:09:29 |
30300100 |
130752344 |
77 |
1840051200 |
78 |
8001715 |
21 |
6 |
위에 데이터를 아래처럼 표현하고 싶습니다. 어떻게 해야될까요?
내용을 설명드리면 T5의 7자리와 T7의 7자리를 하나의 행으로 하여 T8과 T9의 합 입니다.이때 T1은 처음행 시작한 시간을 사용하구요.
한ROW건너 하나의 행으로 계속 이루어 지지 않아서... 그런 부분을 어떻게 해결해야 될까요?
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
T7 |
T8 |
T9 |
2014/04/01 08:00:00 |
30300100 |
130752344 |
67 |
8007042 |
69 |
8002734 |
20 |
2 |
2014/04/01 08:01:01 |
30300100 |
130752344 |
69 |
8002734 |
71 |
8001929 |
197 |
11 |
2014/04/01 08:04:43 |
30300100 |
130752344 |
71 |
8001929 |
73 |
8002433 |
83 |
1 |
2014/04/01 08:00:00 |
30300100 |
130752344 |
73 |
8002433 |
75 |
8002432 |
128 |
2 |
2014/04/01 08:00:00 |
30300100 |
130752344 |
75 |
8002432 |
78 |
8001715 |
51 |
13 |
|