Requête |
with R1 as
(select distinct pays as ABSCISSE,strate,libel_engin as GROUPE,
count(no_menage)*txa as total from
total.liste_site
inner join total.calcul_txa using (strate,pays)
inner join total.v_liste_menage using (no_site,pays)
inner join total.v_menage_engin using(no_menage,pays)
group by pays,libel_engin,txa,strate order by total desc)
select distinct GROUPE as ABSCISSE,100*sum(total)/som_total as total from
R1 ,(select sum(total) as som_total from R1 ) R2
group by groupe,som_total
|