1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| declare
cursor cur_Cont is
select E.ct_ncc, E.ct_nom, E.ct_loc, E.ct_bp, E.ct_tel
from Employe E, (
select D1.dp_ncc , nvl(sum(D1.dp_mtdp),0) Total
from depot D1
where d1.dp_mois = :stat_depot.txt_val_mois
and d1.dp_an = :critere.exo_inf
and d1.dp_typimp = :critere.rg_natimp
Group by D1.dp_ncc
) Dep1
(
select D1.dp_ncc , nvl(sum(D2.dp_mtdp),0) Total
from depot d2
where d2.dp_mois = :stat_depot.txt_val_mois
and d2.dp_an = :critere.exo_sup
and d2.dp_typimp = :critere.rg_natimp
Group by D2.dp_ncc
) Dep2
Where E.ct_cdecdi = :critere.cdecdi
And E.ct_ncc = Dep1.dp_ncc
And E.ct_ncc = Dep2.dp_ncc
And Dep1.total < Dep2.total
order by E.ct_ncc asc ; |
Partager