supongo que querras decir "que tengan el mayor 'number'".
podrias hacerlo asi si tu gestor de bases de datos soporta subconsultas:
Código:
select
t1.id1,
t1.id2,
max(t1.number) as number,
(select t2.descrip from tabla as t2 where t2.id1 = t1.id1 and t2.id2 = t1.id1 and and t2.number = t1.number) as descrip
from tabla as t1
group by t1.id1, t1.id2
si tu gestor de bases de datos no soporta subconsultas, la mejor opcion es realizar dos consultas por separado:
Código:
select id1, id2, max(number) as number
from tabla
group by id1, id2
luego vas recorriendo los datos de esta consulta y para cada terna (id1, id2, number) devuelta por la consulta anterior lanzas la consulta:
Código:
select descrip
from tabla
where id1 = <parametro id1>
and id2 = <parametro id2>
and number = <parametro number>