Автор: egorr [Vladivostok] (83.149.53.---)
Дата: давно
select
dvtarget.dim_detail_groups.dgrp_name,
dvtarget.dim_regions.reg_name,
sum(bill_curr_bill_details.amount_$) ,
grouping(dvtarget.dim_detail_groups.dgrp_name),
grouping(dvtarget.dim_regions.reg_name),
grouping_id(dvtarget.dim_detail_groups.dgrp_name, dvtarget.dim_regions.reg_name)
from unv_fin.bill_curr_bill_details, dvtarget.dim_regions, dvtarget.dim_detail_groups
where dvtarget.dim_detail_groups.dgrp_id = bill_curr_bill_details.detg_detg_id
and dvtarget.dim_regions.reg_id = bill_curr_bill_details.reg_id
group by grouping sets ((dvtarget.dim_regions.reg_name, dvtarget.dim_detail_groups.dgrp_name), (), (dvtarget.dim_detail_groups.dgrp_name))
| |