diff --git a/backend/cmd/db/get_user_questions.go b/backend/cmd/db/get_user_questions.go index c0e69ff..6d88162 100644 --- a/backend/cmd/db/get_user_questions.go +++ b/backend/cmd/db/get_user_questions.go @@ -44,7 +44,7 @@ func GetUserQuestions(respondentID int) ([]UserQuestions, error) { log.Fatalf("Error connecting to the database: %v\n", err) } - getQuestionsStatement := `SELECT s.SpørsmålID, s.tekst + getQuestionsStatement := `SELECT DISTINCT s.SpørsmålID, s.tekst FROM Spørsmål s LEFT JOIN Spørsmålsvar ss ON s.spørsmålID = ss.spørsmålID LEFT JOIN SvarVurdering sv ON ss.svarID = sv.svarID AND sv.respondentID = $1