From ab95963a8885d111596bac74dafe4da2d8e7483d Mon Sep 17 00:00:00 2001 From: mst Date: Tue, 17 Dec 2024 16:06:37 +0300 Subject: [PATCH] select pinned questions first --- functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.py b/functions.py index cabc3fc..44aa708 100644 --- a/functions.py +++ b/functions.py @@ -144,7 +144,7 @@ def getAllQuestions(): GROUP BY question_id ) a ON q.id = a.question_id WHERE q.answered = %s - ORDER BY (a.creation_date IS NULL), a.creation_date DESC, q.pinned DESC, q.creation_date DESC + ORDER BY q.pinned DESC, (a.creation_date IS NULL), a.creation_date DESC, q.creation_date DESC """ cursor.execute(query, (True,))