update sqlc gen

This commit is contained in:
Pavel 2024-03-17 21:10:10 +03:00
parent 0f05193fb5
commit 847302fbff
2 changed files with 32 additions and 32 deletions

@ -535,22 +535,22 @@ WITH Funnel AS (
COUNT(*) >= 1
),
Questions AS (
SELECT
q.title AS question_title,
a.content AS answer_content,
COUNT(a.id) * 100.0 / NULLIF(SUM(COUNT(a.id)) OVER (PARTITION BY q.id), 0) AS percentage
FROM
question q
JOIN answer a ON q.id = a.question_id
WHERE
a.quiz_id = $1
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.id, q.title, a.content
HAVING
COUNT(a.id) >= 1
)
SELECT
q.title AS question_title,
a.content AS answer_content,
COUNT(a.id) * 100.0 / NULLIF(SUM(COUNT(a.id)) OVER (PARTITION BY q.id), 0) AS percentage
FROM
question q
JOIN answer a ON q.id = a.question_id
WHERE
a.quiz_id = $1
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.id, q.title, a.content
HAVING
COUNT(a.id) >= 1
)
SELECT
Funnel.count_start_false,
Funnel.count_start_true,

@ -1629,22 +1629,22 @@ WITH Funnel AS (
COUNT(*) >= 1
),
Questions AS (
SELECT
q.title AS question_title,
a.content AS answer_content,
COUNT(a.id) * 100.0 / NULLIF(SUM(COUNT(a.id)) OVER (PARTITION BY q.id), 0) AS percentage
FROM
question q
JOIN answer a ON q.id = a.question_id
WHERE
a.quiz_id = $1
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.id, q.title, a.content
HAVING
COUNT(a.id) >= 1
)
SELECT
q.title AS question_title,
a.content AS answer_content,
COUNT(a.id) * 100.0 / NULLIF(SUM(COUNT(a.id)) OVER (PARTITION BY q.id), 0) AS percentage
FROM
question q
JOIN answer a ON q.id = a.question_id
WHERE
a.quiz_id = $1
AND a.created_at >= TO_TIMESTAMP($2)
AND a.created_at <= TO_TIMESTAMP($3)
GROUP BY
q.id, q.title, a.content
HAVING
COUNT(a.id) >= 1
)
SELECT
Funnel.count_start_false,
Funnel.count_start_true,