SELECT
(select id from test as t where t.numero = min(test.numero) and idtipo = test.idtipo) as id,
idtipo,
min(numero) as tot
FROM
test
group by idtipo

forse si può fare anche usando distinct