Comparison Clarification
declare @a table (Key_number int,  Country varchar(100));
insert into @a values
(123,         'Apple'),
(123,         'Orange'),
(456,         'Cherry'),
(456,         'Apricot');

declare @b table (Country varchar(100), Rating int);
insert into @b values
('Apple',   5),
('Orange',  4),
('Cherry',  8),
('Apricot', 2);

select top(1) with ties a.*, b.Rating
from @a a join @b b
        on a.Country = b.Country
order by row_number() over(partition by a.Key_number order by b.Rating);