et voilà
codice:
select
sum(case when tabella.a01 in (1,2) then 1 else 0 end +
case when tabella.a02 in (1,2) then 1 else 0 end +
case when tabella.a03 in (1,2) then 1 else 0 end +
case when tabella.a04 in (1,2) then 1 else 0 end +
case when tabella.a05 in (1,2) then 1 else 0 end +
case when tabella.a06 in (1,2) then 1 else 0 end +
case when tabella.a07 in (1,2) then 1 else 0 end +
case when tabella.a08 in (1,2) then 1 else 0 end +
case when tabella.a09 in (1,2) then 1 else 0 end) as Punti12,
sum(case when tabella.a01 in (3,4) then 1 else 0 end +
case when tabella.a02 in (3,4) then 1 else 0 end +
case when tabella.a03 in (3,4) then 1 else 0 end +
case when tabella.a04 in (3,4) then 1 else 0 end +
case when tabella.a05 in (3,4) then 1 else 0 end +
case when tabella.a06 in (3,4) then 1 else 0 end +
case when tabella.a07 in (3,4) then 1 else 0 end +
case when tabella.a08 in (3,4) then 1 else 0 end +
case when tabella.a09 in (3,4) then 1 else 0 end) as Punti34,
sum(case when tabella.a01 in (5,6) then 1 else 0 end +
case when tabella.a02 in (5,6) then 1 else 0 end +
case when tabella.a03 in (5,6) then 1 else 0 end +
case when tabella.a04 in (5,6) then 1 else 0 end +
case when tabella.a05 in (5,6) then 1 else 0 end +
case when tabella.a06 in (5,6) then 1 else 0 end +
case when tabella.a07 in (5,6) then 1 else 0 end +
case when tabella.a08 in (5,6) then 1 else 0 end +
case when tabella.a09 in (5,6) then 1 else 0 end) as Punti56
FROM tabella
ciao