Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------Введение-----------------------------------------
- SELECT t.h01_id, -- идентификатор записи (уникальны)
- t.isn, -- идентификатор SMS сообщения (одинаковы для "I" и "D" - т.к. сообщение одно же)
- t.sms_id AS id, -- идентификатор принадлежности для разбитых SMS (здесь будет номер главного (родительского) SMS для каждой части)
- t.sms_part_id AS part, -- часть сообщения (номер части разбитого сообщения)
- t.h01_text_len AS len, -- длинна сообщения
- t.h01_text,
- t.h01_src_number,
- t.h01_dst_number,
- t.dt_entry_time,
- t.dt_final_time,
- (t.dt_final_time - t.dt_entry_time) AS timing, -- время доставки
- t.h08_state_id,
- t2.h08_desc AS статус, -- расшифровка статуса сообщения
- t.delivery_attempts,
- -- t.h01_encoding,
- t3.note AS textcode, -- коддировка текста
- t.h11_message_class,
- -- t.h04_src_class_id,
- -- t1.*,
- t1.h04_name AS откуда, -- с какого интефейса SMS пришла
- t1.h04_desc,
- -- t.h04_dst_class_id,
- -- t12.*,
- t12.h04_name AS куда, -- на какой интерфейс SMS ушла
- t12.h04_desc,
- t.hm09_atype,
- -- t.hm16_acell_id,
- t5.hm16_name AS с_оператора, -- c какого оператора
- -- t.hm15_aregion_id,
- t4.hm04_name AS с_региона, -- из какого региона
- t.hm09_btype,
- -- t.hm16_bcell_id,
- t51.hm16_name AS на_оператора, -- на какого оператора
- -- t.hm15_bregion_id,
- t41.hm04_name AS на_регион, -- в какой регион
- t.h01_priority
- FROM ew_storage.h01_cdr t,
- ew_storage.h04_class t1,
- ew_storage.h04_class t12,
- ew_storage.h08_state t2,
- ew_storage.sms_encoding t3,
- comverse_storage.hm04_region t4,
- comverse_storage.hm04_region t41,
- comverse_storage.hm16_cellularcarrier t5,
- comverse_storage.hm16_cellularcarrier t51
- WHERE t.h04_src_class_id = t1.h04_class_id(+)
- AND t.h04_dst_class_id = t12.h04_class_id(+)
- AND t.h08_state_id = t2.h08_state_id(+)
- AND t.h01_encoding = t3.id(+)
- AND t.hm15_aregion_id = t4.hm04_region_id(+)
- AND t.hm15_bregion_id = t41.hm04_region_id(+)
- AND t.hm16_acell_id = t5.hm16_cellularcarrier_id(+)
- AND t.hm16_bcell_id = t51.hm16_cellularcarrier_id(+)
- ------------------------------------------------------------------------------------------------------------------------
- ------------------------------Изменяемая часть--------------------------------------------------------------------------
- ------------------------------------------------------------------------------------------------------------------------
- AND t.dt_entry_time
- > sysdate - 1
- -- between TO_DATE('2014-04-01 00:01', 'YYYY-MM-DD HH24:MI')
- --and TO_DATE('2014-04-30 23:59', 'YYYY-MM-DD HH24:MI')
- AND t.h01_text LIKE 'Уважаемый абонент, изменились регионы предоставления услуги национального роуминга. Подробнее на www.skylink.ru'
- -- and t.h01_dst_number like '%810998907218404'
- AND t.h01_src_number LIKE '5678'
- --and t.h08_state_id ='D'
- ORDER BY t.dt_entry_time DESC
- /*
- select count(1), hc1.h01_src_number, hc1.h08_state_id
- from ew_storage.h01_cdr hc1
- where hc1.dt_entry_time
- between TO_DATE('2012-03-29 00:01', 'YYYY-MM-DD HH24:MI')
- and TO_DATE('2012-03-29 23:59', 'YYYY-MM-DD HH24:MI')
- --and hc1.h01_src_number like = '9015167022'
- and hc1.h01_text like 'Полиция предупреждает: опасайтесь мошенников! Не отдавайте деньги, не посоветовавшись с %'
- group by hc1.h01_src_number, hc1.h08_state_id
- */
- SELECT COUNT(hc1.h01_id), hc1.hm16_bcell_id, hc2.hm16_name
- FROM ew_storage.h01_cdr hc1, comverse_storage.hm16_cellularcarrier hc2
- WHERE hc1.hm16_bcell_id = hc2.hm16_cellularcarrier_id(+)
- AND hc1.dt_entry_time
- BETWEEN TO_DATE('2012-05-21 00:01', 'YYYY-MM-DD HH24:MI')
- AND TO_DATE('2012-05-22 23:59', 'YYYY-MM-DD HH24:MI')
- AND hc1.h08_state_id = 'I'
- GROUP BY hc1.hm16_bcell_id, hc2.hm16_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement