CREATE OR REPLACE VIEW public.local_person_aggregates AS
 SELECT person_aggregates.id AS "person_aggregates.id",
    person_aggregates.person_id AS "person_aggregates.person_id",
    person_aggregates.post_count AS "person_aggregates.post_count",
    person_aggregates.post_score AS "person_aggregates.post_score",
    person_aggregates.comment_count AS "person_aggregates.comment_count",
    person_aggregates.comment_score AS "person_aggregates.comment_score"
   FROM (local_user
     JOIN person_aggregates ON ((person_aggregates.person_id = local_user.person_id)));

This will create a view within the Lemmy database, for reusability. If you just want to run a one-off query or prefer to store it in other form, omit the first line.