Requete invalide ici : pour transitions with req1 as ( select num_region_new_intitule, nom_form_niv_det_intitule, N from (select *, ROW_NUMBER() OVER (PARTITION BY H.num_region_new_intitule ORDER BY num_region_new_intitule, total desc) as N from ( select R.num_region_new_intitule, R.nom_form_niv_det_intitule, count(num_otp) as total from (select distinct num_region_new_intitule, nom_form_niv_det_intitule, num_otp from amont a inner join ref_nom_formation using (nom_form_niv_det) inner join ref_region on (num_region_new_new=ref_region.num_region_new)) R group by R.num_region_new_intitule, R.nom_form_niv_det_intitule) H) as X where N <= 3 order by X.num_region_new_intitule, X.total desc), req2 as (select num_region_new_intitule, nom_form_niv_det_intitule as nsf1 from req1 where n=1), req3 as (select num_region_new_intitule, nom_form_niv_det_intitule as nsf2 from req1 where n=2), req4 as (select num_region_new_intitule, nom_form_niv_det_intitule as nsf3 from req1 where n=3) select * from req2 left join req3 using (num_region_new_intitule) left join req4 using (num_region_new_intitule)