update InsertAnswers query
This commit is contained in:
parent
70b7251bc7
commit
8bca2a49aa
@ -291,7 +291,7 @@ WHERE
|
|||||||
a.session = $1 AND a.start = false AND a.deleted = false
|
a.session = $1 AND a.start = false AND a.deleted = false
|
||||||
ORDER BY
|
ORDER BY
|
||||||
a.question_id ASC, a.created_at DESC;
|
a.question_id ASC, a.created_at DESC;
|
||||||
-- name: InsertAnswers :exec
|
-- name: InsertAnswers :one
|
||||||
INSERT INTO answer(
|
INSERT INTO answer(
|
||||||
content,
|
content,
|
||||||
quiz_id,
|
quiz_id,
|
||||||
@ -307,7 +307,8 @@ INSERT INTO answer(
|
|||||||
ip,
|
ip,
|
||||||
start,
|
start,
|
||||||
utm
|
utm
|
||||||
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14);
|
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)
|
||||||
|
RETURNING *;
|
||||||
|
|
||||||
-- name: GetResultAnswers :many
|
-- name: GetResultAnswers :many
|
||||||
SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint, session,created_at, result, new,deleted, device_type,device,os,browser,ip FROM answer WHERE session = (
|
SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint, session,created_at, result, new,deleted, device_type,device,os,browser,ip FROM answer WHERE session = (
|
||||||
|
Loading…
Reference in New Issue
Block a user