sql/queries: add chapter-count-by-city.sql
This commit is contained in:
parent
fb38880cbc
commit
fb519c9304
1 changed files with 22 additions and 0 deletions
22
src/sql/queries/chapter-count-by-city.sql
Normal file
22
src/sql/queries/chapter-count-by-city.sql
Normal file
|
@ -0,0 +1,22 @@
|
|||
-- | DESCRIPTION
|
||||
--
|
||||
-- This query groups the number of chapters to one of two
|
||||
-- cities they were revealed in: either Makkah, or Medina.
|
||||
--
|
||||
-- | EXAMPLE RESULT SET
|
||||
--
|
||||
-- city chapters
|
||||
-- ------- --------
|
||||
-- Madinah 28
|
||||
-- Makkah 86
|
||||
|
||||
SELECT
|
||||
chapters.city,
|
||||
COUNT(chapters.city) AS chapters
|
||||
from
|
||||
chapters
|
||||
where
|
||||
chapters.quran_id = 1
|
||||
GROUP BY
|
||||
chapters.city;
|
||||
|
Loading…
Reference in a new issue