Отчет для директора

Ключ
Эта строка удалена.
Это слово было удалено. Это слово было добавлено.
Эта строка добавлена.

Изменения (2)

просмотр истории страницы

Через [конструктор отчетов|CarbonBilling:Конструктор отчетов] запросом:
{code}select cnt.y*100+cnt.m, round(cnt.sm/count(*),3) from (select round(sum(summ),3) sm,year_number y,month_number m from counters c where abonent_id>0 group by year_number,month_number) cnt join (select distinct a.id aid,extract(year from create_date) y,extract(month from create_date) m from abonents a where id>0 and is_folder=0) abn on abn.y*100+abn.m<=cnt.y*100+cnt.m group by cnt.y,cnt.m,cnt.sm{code}
{code}select
cnt.y*100+cnt.m,
round(cnt.sm/count(*),3)
from
(select round(sum(summ),3) sm,year_number y,month_number m from counters c where abonent_id>0 group by year_number,month_number) cnt
join (select distinct a.id aid,extract(year from create_date) y,extract(month from create_date) m from abonents a where id>0 and is_folder=0) abn
on abn.y*100+abn.m<=cnt.y*100+cnt.m
group
by cnt.y,cnt.m,cnt.sm
{code}

h2. ARPPU