declare @tb table(F1 int,F2 varchar(10),F3 int)
insert into @tb
select 1,'A',123 union all
select 2,'B',123 union all
select 3,'A',222 union all
select 4,'A',234 union all
select 5,'B',111
select a.* from @tb a right join (
select f2,f3=max(f3) from @tb group by f2)b
on a.f2=b.f2 and a.f3=b.f3
/*
F1 F2 F3
----------- ---------- -----------
4 A 234
2 B 123