Per completare la query nel caso in cui altri ne abbiano bisogno:
select ua.user_id, u.username, sum(action_type) actions, sum(case action_type when 5 then 1 else 0 end) replies from user_actions ua
join users u on u.id = ua.user_id
join topics t on target_topic_id = t.id
where ua.created_at > 'YYYY-MM-DD'::date and t.category_id = CATEGORY_ID
group by ua.user_id, u.username;
Sostituisci semplicemente YYY-MM-DD con la tua data di riferimento e CATEGORY_ID con il tuo ID di categoria.
Il risultato mostrerà user_id, username, actions e replies.