Monthly Adoptions By Species
###
Financial Charts
###
3000/MySQL rev01
###
The number of adoptions per month, broken down by species.
###
en
###
SELECT
s.SpeciesName, 
MONTH(ad.MovementDate) AS bimonth,
COUNT(ad.ID) AS total
FROM adoption ad
INNER JOIN animal a ON ad.AnimalID = a.ID
INNER JOIN species s ON s.ID = a.SpeciesID
WHERE YEAR(ad.MovementDate) = $ASK STRING Which year to display for?$
AND ad.MovementType = 1
GROUP BY s.SpeciesName, MONTH(ad.MovementDate)
###
GRAPH BARS
&&&
Monthly Adoptions By Species
###
Financial Charts
###
3000/PostgreSQL rev01
###
The number of adoptions per month, broken down by species.
###
en
###
SELECT
s.SpeciesName, 
CAST(EXTRACT(MONTH FROM ad.MovementDate) AS INTEGER) AS bimonth,
COUNT(ad.ID) AS total
FROM adoption ad
INNER JOIN animal a ON ad.AnimalID = a.ID
INNER JOIN species s ON s.ID = a.SpeciesID
WHERE CAST(EXTRACT(YEAR FROM ad.MovementDate) AS INTEGER) = $ASK STRING Which year to display for?$
AND ad.MovementType = 1
GROUP BY s.SpeciesName, EXTRACT(MONTH FROM ad.MovementDate)
###
GRAPH BARS
