praekelt/ummeli — comment on commit 435478026a5439bad75cadb906b673e605e845f8
File:  line 0
By miltontony:

SELECT "base_province"."search_id", "base_province"."name", COUNT("base_category_user_submitted_job_articles"."usersubmittedjobarticle_id") AS "userarticles_count", COUNT("base_category_articles"."article_id") AS "articles_count" FROM "base_province" LEFT OUTER JOIN "base_category" ON ("base_province"."search_id" = "base_category"."province_id") LEFT OUTER JOIN "base_category_user_submitted_job_articles" ON ("base_category"."id" = "base_category_user_submitted_job_articles"."category_id") LEFT OUTER JOIN "base_category_articles" ON ("base_category"."id" = "base_category_articles"."category_id") GROUP BY "base_province"."search_id", "base_province"."name", "base_province"."search_id", "base_province"."name" ORDER BY "base_province"."name" ASC