Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ---------------------------Введение-----------------------------------------
  3. SELECT t.h01_id,                 -- идентификатор записи (уникальны)
  4.        t.isn,                    -- идентификатор SMS сообщения (одинаковы для "I" и "D" - т.к. сообщение одно же)
  5.        t.sms_id AS id,           -- идентификатор принадлежности для разбитых SMS (здесь будет номер главного (родительского) SMS для каждой части)
  6.        t.sms_part_id AS part,    -- часть сообщения (номер части разбитого сообщения)
  7.        t.h01_text_len AS len,    -- длинна сообщения
  8.        t.h01_text,
  9.        t.h01_src_number,
  10.        t.h01_dst_number,
  11.        t.dt_entry_time,
  12.        t.dt_final_time,
  13.        (t.dt_final_time - t.dt_entry_time) AS timing, -- время доставки
  14.        t.h08_state_id,
  15.        t2.h08_desc AS статус,         -- расшифровка статуса сообщения
  16.        t.delivery_attempts,
  17.        -- t.h01_encoding,
  18.        t3.note AS textcode,           -- коддировка текста
  19.        t.h11_message_class,
  20.        -- t.h04_src_class_id,
  21.        -- t1.*,
  22.        t1.h04_name AS откуда,         -- с какого интефейса SMS пришла
  23.        t1.h04_desc,
  24.        -- t.h04_dst_class_id,
  25.        -- t12.*,
  26.        t12.h04_name AS куда,          -- на какой интерфейс SMS ушла
  27.        t12.h04_desc,
  28.        t.hm09_atype,
  29.        -- t.hm16_acell_id,
  30.        t5.hm16_name AS с_оператора,   -- c какого оператора
  31.        -- t.hm15_aregion_id,
  32.        t4.hm04_name AS с_региона,     -- из какого региона
  33.        t.hm09_btype,
  34.        -- t.hm16_bcell_id,
  35.        t51.hm16_name AS на_оператора, -- на какого оператора
  36.        -- t.hm15_bregion_id,
  37.        t41.hm04_name AS на_регион,    -- в какой регион
  38.        t.h01_priority
  39.   FROM ew_storage.h01_cdr                    t,
  40.        ew_storage.h04_class                  t1,
  41.        ew_storage.h04_class                  t12,
  42.        ew_storage.h08_state                  t2,
  43.        ew_storage.sms_encoding               t3,
  44.        comverse_storage.hm04_region          t4,
  45.        comverse_storage.hm04_region          t41,
  46.        comverse_storage.hm16_cellularcarrier t5,
  47.        comverse_storage.hm16_cellularcarrier t51
  48.  WHERE t.h04_src_class_id = t1.h04_class_id(+)
  49.    AND t.h04_dst_class_id = t12.h04_class_id(+)
  50.    AND t.h08_state_id = t2.h08_state_id(+)
  51.    AND t.h01_encoding = t3.id(+)
  52.    AND t.hm15_aregion_id = t4.hm04_region_id(+)
  53.    AND t.hm15_bregion_id = t41.hm04_region_id(+)
  54.    AND t.hm16_acell_id = t5.hm16_cellularcarrier_id(+)
  55.    AND t.hm16_bcell_id = t51.hm16_cellularcarrier_id(+)
  56.       ------------------------------------------------------------------------------------------------------------------------
  57.       ------------------------------Изменяемая часть--------------------------------------------------------------------------
  58.       ------------------------------------------------------------------------------------------------------------------------
  59.    AND t.dt_entry_time
  60.   > sysdate - 1
  61.  --  between TO_DATE('2014-04-01 00:01', 'YYYY-MM-DD HH24:MI')
  62.    --and TO_DATE('2014-04-30 23:59', 'YYYY-MM-DD HH24:MI')
  63.   AND t.h01_text LIKE 'Уважаемый абонент, изменились регионы предоставления услуги национального роуминга. Подробнее на www.skylink.ru'
  64.  --  and t.h01_dst_number like '%810998907218404'
  65.    AND t.h01_src_number LIKE '5678'
  66.  --and t.h08_state_id ='D'
  67.  ORDER BY t.dt_entry_time DESC
  68.  
  69.  /*
  70. select count(1), hc1.h01_src_number,  hc1.h08_state_id
  71. from ew_storage.h01_cdr hc1
  72. where hc1.dt_entry_time
  73. between TO_DATE('2012-03-29 00:01', 'YYYY-MM-DD HH24:MI')
  74.     and TO_DATE('2012-03-29 23:59', 'YYYY-MM-DD HH24:MI')
  75. --and hc1.h01_src_number like = '9015167022'
  76. and hc1.h01_text like 'Полиция предупреждает: опасайтесь мошенников! Не отдавайте деньги, не посоветовавшись с %'
  77. group by hc1.h01_src_number,  hc1.h08_state_id
  78. */
  79.  
  80. SELECT COUNT(hc1.h01_id), hc1.hm16_bcell_id, hc2.hm16_name
  81. FROM ew_storage.h01_cdr hc1, comverse_storage.hm16_cellularcarrier hc2
  82. WHERE hc1.hm16_bcell_id = hc2.hm16_cellularcarrier_id(+)
  83. AND hc1.dt_entry_time
  84. BETWEEN TO_DATE('2012-05-21 00:01', 'YYYY-MM-DD HH24:MI')
  85.     AND TO_DATE('2012-05-22 23:59', 'YYYY-MM-DD HH24:MI')
  86.     AND hc1.h08_state_id = 'I'
  87.  
  88. GROUP BY hc1.hm16_bcell_id,  hc2.hm16_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement