Get “group by” parameter column name/ alias from another table

Join to those tables.

    SELECT c.category_name, sc.sub_category_name, count(p.*)
    FROM podcasts p
    join categories c
      on c.category_id = p.podcast_category_id
    join sub_categories sc
      on sc.sub_category_id = p.podcast_subcategory_id
    where p.podcast_owner = 14 
      AND p.podcast_upload_time_stamp >= timestamp '2020-10-22 00:00:00'
    GROUP BY 1,2

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top