Build a select query that includes aggregated values from a different table
You can use filtered aggregation for this:
select v.poll_id, 
       count(*) filter (where v.option = p.option_a) as option_a, 
       count(*) filter (where v.option = p.option_b) as option_b,
       max(p.created_at) as created_at
from votes v 
  join polls p on p.id = v.poll_id
group by v.poll_id
order by v.poll_id;

The max(p.created_at) is necessary to make the group by happy.
Online example