$query1 = "select "
$masiB = [$g1 => " sum (case when t.subs_subs_id = 244 then t.sum_real_volume/60 end)",
$g2 => " sum (case when t.subs_subs_id = 246 then t.sum_real_volume/60 end)",
$g3 => " sum (case when t.subs_subs_id = 243 then t.sum_real_volume/60 end)",
$g4 => " sum (case when t.subs_subs_id = 222 then t.sum_real_volume/60 end)",
$g5 => " sum (case when t.subs_subs_id = 249 then t.sum_real_volume/60 end)",
$g6 => " sum (case when t.subs_subs_id = 662 then t.sum_real_volume/60 end)"]
$query2 = " trunc(t.start_date, '$g9')
from shops t,
prodazhi c
where c.subs_id = t.subs_subs_id
and t.start_date >= to_date('$g7', 'yyyy/mm/dd')
and t.start_date <= to_date('$g8', 'yyyy/mm/dd')
group by trunc(t.start_date, '$g9')";
string(468) "select sum(case when t.subs_subs_id = 244 then t.sum_real_volume/60 end), sum(case when t.subs_subs_id = 246 then t.sum_real_volume/60 end), trunc(t.start_date, 'dd') from dwh.fact_itc_trafic t, dwh.ITC_DIM_SUBSCRIBERS c where c.subs_id = t.subs_subs_id and t.start_date >= to_date('2020-09-02', 'yyyy/mm/dd') and t.start_date <= to_date('2020-09-10', 'yyyy/mm/dd') group by trunc(t.start_date, 'dd')"
Написано
Войдите на сайт
Чтобы задать вопрос и получить на него квалифицированный ответ.