---如果仅有这2列:
select id ,max(num) as num from tb group by id order by id
---如果还有其他列,可以:
select * from tb a where not exists(select * from tb where id=a.id and num>a.num )
or:
select * from tb a inner join (select id ,max(num) as num from tb group by id )b on a.id=b.id and a.num=b.num