Skip to content

Commit

Permalink
stat totals remove duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatMegamind committed May 12, 2024
1 parent 45e19f6 commit dc1ca99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/publishedSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ publishedScheduleRouter.get('/stats', async (req, res) => {
SELECT
COALESCE(ap.event_type::text, 'Total') AS event_type,
COALESCE(ap.subject::text, 'Total') AS subject,
COALESCE(COUNT(c.catalog_id), 0) AS total_count
COALESCE(COUNT(DISTINCT ps_event_id), 0) AS total_count
FROM all_permutations ap
LEFT JOIN (
SELECT *,
ps.day_id AS ps_day_id,
c.id AS catalog_id
ps.id AS ps_event_id
FROM catalog c
JOIN published_schedule ps ON c.id = ps.event_id
JOIN day d ON PS.day_id = d.id
Expand Down

0 comments on commit dc1ca99

Please sign in to comment.