You need to find the max within the group of primary_key_id
and then filter out the result with field_b that is equal to max value within the group. Hope it helps
select field_a, field_b
from (select field_a,
field_b,
max(field_b) over (partition by primary_key_id) as max_b
from table_a)
where primary_key_id=123
and field_b = max_b;