update sqlc gen

This commit is contained in:
Pavel 2024-03-17 22:25:41 +03:00
parent 6218cbd69c
commit ad4a8f77dc
2 changed files with 3 additions and 3 deletions

@ -503,7 +503,7 @@ WITH Funnel AS (
SELECT
q.title AS question_title,
COUNT(*) AS total_answers,
COUNT(*) * 100.0 / NULLIF(SUM(COUNT(*)) FILTER (WHERE a.result = TRUE) OVER (PARTITION BY a.quiz_id), 0) AS percentage
CAST(COUNT(*) * 100.0 / NULLIF(SUM(COUNT(*)) FILTER (WHERE a.result = TRUE) OVER (PARTITION BY a.quiz_id), 0) AS FLOAT8) AS percentage
FROM
question q
JOIN answer a ON q.id = a.question_id

@ -1597,7 +1597,7 @@ WITH Funnel AS (
SELECT
q.title AS question_title,
COUNT(*) AS total_answers,
COUNT(*) * 100.0 / NULLIF(SUM(COUNT(*)) FILTER (WHERE a.result = TRUE) OVER (PARTITION BY a.quiz_id), 0) AS percentage
CAST(COUNT(*) * 100.0 / NULLIF(SUM(COUNT(*)) FILTER (WHERE a.result = TRUE) OVER (PARTITION BY a.quiz_id), 0) AS FLOAT8) AS percentage
FROM
question q
JOIN answer a ON q.id = a.question_id
@ -1659,7 +1659,7 @@ type QuestionsStatisticsRow struct {
CountFResultWithTQuestion int64 `db:"count_f_result_with_t_question" json:"count_f_result_with_t_question"`
CountTResult int64 `db:"count_t_result" json:"count_t_result"`
ResultsTitle string `db:"results_title" json:"results_title"`
ResultsPercentage int32 `db:"results_percentage" json:"results_percentage"`
ResultsPercentage float64 `db:"results_percentage" json:"results_percentage"`
QuestionsTitle string `db:"questions_title" json:"questions_title"`
AnswerContent sql.NullString `db:"answer_content" json:"answer_content"`
QuestionsPercentage float64 `db:"questions_percentage" json:"questions_percentage"`