Hi

Am I missing something?

    select p.person_nbr
          ,p.company_nbr
          ,max(c.next_contact) -- the lasted contact in the group
      from people as p
inner join contacts as c
        on p.contact_id = c.id -- assumed join condition
     where c.next_contact >= '2025-11-01'
  group by p.person_nbr  -- the group for which the latest contact is wanted
          ,p.company_nbr
  order by p.person_nbr
          ,p.company_nbr;

Kind regards

Thiemo




Reply via email to