update sqlc gen

This commit is contained in:
Pavel 2024-03-17 21:51:09 +03:00
parent a1e594113d
commit d65f806e0c
2 changed files with 3 additions and 3 deletions

@ -539,7 +539,7 @@ WITH Funnel AS (
q.title AS question_title,
a.content AS answer_content,
CAST(
COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END) * 100.0 / NULLIF(SUM(COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END)) OVER (PARTITION BY q.id), 0) AS DECIMAL(10, 2)
COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END) * 100.0 / NULLIF(SUM(COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END)) OVER (PARTITION BY q.id), 0) AS FLOAT8
) AS percentage
FROM
question q

@ -1633,7 +1633,7 @@ WITH Funnel AS (
q.title AS question_title,
a.content AS answer_content,
CAST(
COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END) * 100.0 / NULLIF(SUM(COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END)) OVER (PARTITION BY q.id), 0) AS DECIMAL(10, 2)
COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END) * 100.0 / NULLIF(SUM(COUNT(CASE WHEN a.result = FALSE THEN 1 ELSE NULL END)) OVER (PARTITION BY q.id), 0) AS FLOAT8
) AS percentage
FROM
question q
@ -1680,7 +1680,7 @@ type QuestionsStatisticsRow struct {
ResultsPercentage int32 `db:"results_percentage" json:"results_percentage"`
QuestionsTitle string `db:"questions_title" json:"questions_title"`
AnswerContent sql.NullString `db:"answer_content" json:"answer_content"`
QuestionsPercentage string `db:"questions_percentage" json:"questions_percentage"`
QuestionsPercentage float64 `db:"questions_percentage" json:"questions_percentage"`
}
func (q *Queries) QuestionsStatistics(ctx context.Context, arg QuestionsStatisticsParams) ([]QuestionsStatisticsRow, error) {