update sqlc gen

This commit is contained in:
Pavel 2024-03-17 20:35:47 +03:00
parent 3c3445b8fc
commit 30e78b4dc5
2 changed files with 6 additions and 4 deletions

@ -545,6 +545,7 @@ WITH Funnel AS (
SELECT
q.id,
q.title,
a.content,
COUNT(*) AS total_answers
FROM
question q
@ -555,14 +556,14 @@ WITH Funnel AS (
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.id, q.title
q.id, q.title, a.content
) q ON a.question_id = q.id
WHERE
a.quiz_id = $1
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.title, q.total_answers
q.title, a.content, q.total_answers
HAVING
COUNT(*) >= 1
)

@ -1639,6 +1639,7 @@ WITH Funnel AS (
SELECT
q.id,
q.title,
a.content,
COUNT(*) AS total_answers
FROM
question q
@ -1649,14 +1650,14 @@ WITH Funnel AS (
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.id, q.title
q.id, q.title, a.content
) q ON a.question_id = q.id
WHERE
a.quiz_id = $1
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.title, q.total_answers
q.title, a.content, q.total_answers
HAVING
COUNT(*) >= 1
)