1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| select num numtab1, gam, nom, pre, dan,
'['||ser||'] '||slib service,
'['||ufo||'] '||ulib ufresult,dat, das, rss, grp
from tabh, tabp, tabser,tabu
where and tabser.sermsi = 1
and ser in (PARAM3)
and tabp.pndo = tabh.hndo
and tabh.ser = tabser.cod
and tabh.ufo = tabu.ucod
order by gam,das
into temp taberesult1
select service,ufresult,count(*)nbsansdp from taberesult1
group by 1,2
into temp tab1;
select nom,pre,dan,num,gam,rss,'['||ufo||'] '||ulib ufresult,'['||ser||'] '||slib service,dat,das
from tabh,tabp,tabser,tabu
where and tabp.pndo = tabh.hndo
and tabh.num not in (select nsj from tabrum)
and tabh.num not in (select numtab1 from taberesult1)
and das between PARAM1 and PARAM2
and ser in (PARAM3)
and tabh.ser = tabser.cod
and tabh.ufo = tabu.ucod
into temp taberesult2;
select service,ufresult,count(*) nbsansnumrss from taberesult2
group by 1,2
into temp tab2;
select nosej,numrss,'['||unite||'] '||ulib ufresult,'['||rser||'] '||slib service,entdat,sordat
from tabrum,tabser,tabu
where sordat between PARAM1 and PARAM2
and tabrum.rser in (PARAM3)
and tabrum.rser = tabser.cod
and tabrum.unite = tabu.ucod
into temp taberesult3;
select service,ufresult,count(*) nbavecnumrss from taberesult3
group by 1,2
into temp tab3; |
Partager