select pinned questions first

This commit is contained in:
mst 2024-12-17 16:06:37 +03:00
parent 5f81017d79
commit ab95963a88

View file

@ -144,7 +144,7 @@ def getAllQuestions():
GROUP BY question_id GROUP BY question_id
) a ON q.id = a.question_id ) a ON q.id = a.question_id
WHERE q.answered = %s 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,)) cursor.execute(query, (True,))