select a.type,a.num,a.value
   from table as a  
        inner join 
        (select type, max(num) as max_num from table group by type) as b
        on a.type=b.type and a.num=b.max_num
where a.value=YourValue and a.type=YourType