nessuno può darmi un suggerimento
io ho utilizato questa tecnica però non mi ritorna il raggruppamento delle righe
codice:
DECLARE @TableAssenze Table(sv char(16) not null,op char(16) not null,assenteismo decimal(9,3) NULL,mese char(7) not null)
INSERT INTO @TableAssenze
select sv.SV,gen.OP,gm.Assenteismo,gm.Mese
from sk_generale gen
join sk_merito_sv sv
on gen.OP <> sv.SV
join giornaliera_mese gm
on gm.CF_OP = gen.OP
and gm.mese = gen.Mese
where --gen.ID_GRUPPO = sv.ID_GRUPPO and
gen.OP = gm.CF_OP and gen.Mese = gm.Mese --and gen.Mese = sv.Mese
group by sv.SV,gm.Assenteismo,gm.mese,gen.OP
order by sv.SV,gm.Mese asc--,gm.Assenteismo
select ta.sv,ta.mese,sum(ta.assenteismo)as totale,ta.op FROM @TableAssenze ta
where gen.Mese = ta.Mese --and ta.sv =
group by ta.sv,ta.mese,ta.op.ta.Assenteismo
Grazie ancora