codice:
select 
squadra, 
sum(punteggio) as punti,
count(squadra) as gioc, 
sum(if(punteggio=3,1,0)) as v,
sum(if(punteggio=1,1,0)) as p,
sum(if(punteggio=0,1,0)) as s,
sum(if(punteggio=3 and dove = 'C',1,0)) as vc,
sum(if(punteggio=1 and dove = 'C',1,0)) as pc,
sum(if(punteggio=0 and dove = 'C',1,0)) as sc,
sum(if(punteggio=3 and dove = 'T',1,0)) as vt,
sum(if(punteggio=1 and dove = 'T',1,0)) as pt,
sum(if(punteggio=0 and dove = 'T',1,0)) as st,
sum(fatti) as gtf,
sum(subiti) as gts
from (
select team1 as squadra, v1 as fatti, v2 as subiti,'C' as dove, 
case
when v1 > v2 then 3
when v1 = v2 then 1
else 0
end as punteggio
from calendario
where v1 != '-'
union all
select team2 as squadra, v2 as fatti,v1 as subiti,'T',
case
when v2 > v1 then 3
when v2 = v1 then 1
else 0
end as punteggio
from calendario
where v2 != '-'
) as tab
group by squadra
order by punti desc
P.S. Controlla tra le opzioni di backup del db. Devi avere l'ansi quotes abilitato. Rimuovilo per evitare problemi in fase di reimportazione.