Get list of topics pinned globally

Voici une requête Data Explorer mise à jour qui renvoie une liste plus propre de tous les messages épinglés par catégorie, avec les sujets épinglés globalement en haut :

SELECT pinned_globally, TO_CHAR(pinned_until,'DD/MM/YYYY') as pinned_till, id as topic_id, user_id, category_id 
FROM topics 
WHERE deleted_at IS NULL
AND pinned_at IS NOT NULL
AND (pinned_until IS NULL OR pinned_until > CURRENT_TIMESTAMP)
ORDER BY pinned_globally desc, category_id