안녕하세요
초보 문의 드립니다.
테이블 구조는 다음과 같습니다.
select 'C070' channel_id , '' be_Type , '03:50:00' start_Date , '03:50:00' end_Date from dual union all
select 'C070' , '' , '04:12:15' , '04:12:15' from dual union all
select 'C070' , '' , '04:20:15' , '04:20:15' from dual union all
select 'C070' , '' , '04:20:29' , '04:20:29' from dual union all
select 'C070' , '' , '04:25:03' , '04:25:03' from dual union all
select 'C070' , '' , '04:25:13' , '04:25:13' from dual union all
select 'C070' , '' , '04:30:00' , '04:30:00' from dual union all
select 'C070' , 'B' , '04:30:31' , '04:30:31' from dual union all
select 'C070' , 'B' , '04:30:47' , '04:30:47' from dual union all
select 'C070' , 'B' , '04:30:59' , '04:30:59' from dual union all
select 'C070' , '' , '04:31:11' , '04:31:11' from dual union all
select 'C070' , '' , '04:31:27' , '04:31:27' from dual union all
select 'C070' , '' , '05:16:33' , '05:16:33' from dual union all
select 'C070' , '' , '05:24:33' , '05:24:33' from dual union all
select 'C070' , 'E' , '05:24:46' , '05:24:46' from dual union all
select 'C070' , 'B' , '05:29:40' , '05:29:40' from dual union all
select 'C070' , '' , '05:29:56' , '05:29:56' from dual union all
select 'C070' , '' , '05:30:00' , '05:30:00' from dual union all
select 'C070' , '' , '05:30:08' , '05:30:08' from dual union all
select 'C070' , '' , '05:30:22' , '05:30:22' from dual union all
select 'C070' , '' , '05:31:37' , '05:31:37' from dual union all
select 'C070' , '' , '06:18:02' , '06:18:02' from dual union all
select 'C070' , '' , '06:26:02' , '06:26:02' from dual union all
select 'C070' , '' , '06:26:10' , '06:26:10' from dual union all
select 'C070' , '' , '06:28:10' , '06:28:10' from dual union all
select 'C070' , '' , '06:28:24' , '06:28:24' from dual union all
select 'C070' , 'E' , '06:30:00' , '06:30:00' from dual union all
select 'C070' , 'B' , '06:30:21' , '06:30:21' from dual union all
select 'C070' , '' , '06:30:37' , '06:30:37' from dual union all
select 'C070' , '' , '06:31:05' , '06:31:05' from dual union all
select 'C070' , '' , '06:31:30' , '06:31:30' from dual union all
select 'C070' , '' , '06:31:45' , '06:31:45' from dual union all
select 'C070' , '' , '06:59:52' , '06:59:52' from dual union all
select 'C070' , '' , '07:07:52' , '07:07:52' from dual union all
select 'C070' , '' , '07:08:17' , '07:08:17' from dual union all
select 'C070' , 'E' , '07:10:00' , '07:10:00' from dual union all
select 'C070' , 'B' , '07:10:14' , '07:10:14' from dual union all
select 'C070' , '' , '07:10:30' , '07:10:30' from dual union all
select 'C070' , '' , '07:10:42' , '07:10:42' from dual union all
select 'C070' , '' , '07:11:01' , '07:11:01' from dual union all
select 'C070' , '' , '07:12:15' , '07:12:15' from dual union all
select 'C070' , '' , '08:02:37' , '08:02:37' from dual union all
select 'C070' , '' , '08:10:37' , '08:10:37' from dual union all
select 'C070' , '' , '08:10:45' , '08:10:45' from dual union all
시작 'B' 끝은 'E' 입니다 이 기준으로
이전 값은 버리고 그룹핑한다음에 일련번호를 부여 하고 싶습니다.
B로 시작해서 E로 끝난 데이타만 추출하고자 하는데 잘 않되네요
제가 원하는 데이타는 다음과 같습니다.
1 2015-10-28 오전 4:30:31 2015-10-28 오전 5:24:46
2 2015-10-28 오전 5:29:40 2015-10-28 오전 6:30:00
3 2015-10-28 오전 6:30:21 2015-10-28 오전 7:10:00
고수분들의 많은 도움 부탁드립니다. 감사합니다.
|