Ipotizzando la tabella così:
COD_FISC MESE IMP
1 201101 20
1 201102 50
1 201101 10
dovresti utilizzare un sql tipo questo:
select cod_fisc, sum(m201101), sum(m201102) from (
select cod_fisc,
case when mese=201101 then imp else 0 end as m201101,
case when mese=201102 then imp else 0 end as m201102
from (
select cod_fisc, mese, imp from tabellaimporti
)
)
group by cod_fisc
ovviamente, cambiando opportunamente i valori e il nome dei campi
Ciao
Mik
http://www.HolidaySoft.it
http://www.GarganoSapori.it - Olio ExtraVergine del Gargano
http://www.osteriaoristorante.it - Crea la Vetrina per il tuo Ristorante