1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| SELECT HOPEMPL.SEITYPPOP,HOPEMPL.MATRI, HOPEMPL.NOMPRE,HOPEMPL.HORSECT, HOPSECH.LIBCOURT, HOPSECH.LIBELLE, HOPEMPL.GROUPH,
listagg(HOPROLE.UTIL || ' : ' || coalesce(HOPROLE.HORSECT, ' '), '; ')
within group ( order by HOPROLE.UTIL ) ROL,
valideur.valideur
From HOPEMPL, HOPSECH, HOPCTRA, HOPROLE
LEFT JOIN (
select LISTAGG(x.nompre, '; ' ) WITHIN GROUP (ORDER BY x.nompre) as valideur, x.matri from
( select hopempl.nompre from hopempl ,sfphierd where hopempl.matri = sfphierd.matri ) x
GROUP By x.nompre
) valideur
on hopmepl.matri = valideur.matri
WHERE HOPEMPL.HORSECT = HOPSECH.HORSECT
AND HOPEMPL.MATRI = HOPCTRA.MATRI
AND SYSDATE Between HOPCTRA.DATDEB and HOPCTRA.DATFIN
AND HOPEMPL.SEITYPPOP not in ('V',' ', 'I')
AND HOPEMPL.MATRI not in ('989897','989898','98989826')
AND HOPEMPL.MATRI = HOPROLE.MATRI
GROUP BY (HOPEMPL.SEITYPPOP,HOPEMPL.MATRI, HOPEMPL.NOMPRE,HOPEMPL.HORSECT, HOPSECH.LIBCOURT, HOPSECH.LIBELLE, HOPEMPL.GROUPH, valideur.valideur)
ORDER BY HOPEMPL.HORSECT, HOPEMPL.SEITYPPO |
Partager