Подскажите как можно построить данную таблицу
Наименование (КО №1) - берется с табл t_mo
поле mo
, без одинаковых названий
Наименование2 (МО) – берется с табл t_pet
поле otv_kon
Формат (пусто) – в этом столбце будет всегда пусто
Формат2 (1) – значение const
Принято(0)
select count(*)
from t_block t, t_pet p, t_mo w
where t.id_ger=p.id
and p.mo_id=w.mo_id
and p.conect_id=5
and to_date(t.date_end) between to_date('01.03.2019') and to_date('31.03.2019')
and p.mo_id =10
and p.otv_kon=54001
Принято(44)
select count(*)
from t_block t, t_pet p, t_mo w
where t.id_ger=p.id
and p.mo_id=w.mo_id
and p.conect_id=5
and to_date(t.date_end) between to_date('01.03.2019') and to_date('31.03.2019')
and p.mo_id =12
and p.otv_kon=54001
Закрыто(0)
select count(*)
from t_block t, t_pet p, t_mo w
where t.id_ger=p.id
and p.mo_id=w.mo_id
and p.conect_id=5
and to_date(t.date_end) between to_date('01.03.2019') and to_date('31.03.2019')
and p.mo_id =10
and p.otv_kon=54001
and p.cause in (22,1)
Закрыто(44)
select count(*)
from t_block t, t_pet p, t_mo w
where t.id_ger=p.id
and p.mo_id=w.mo_id
and p.conect_id=5
and to_date(t.date_end) between to_date('01.03.2019') and to_date('31.03.2019')
and p.mo_id =12
and p.otv_kon=54001
and p.cause in (22,1)