Get list of topics pinned globally

Aquí tienes una consulta actualizada del Explorador de Datos que devuelve una lista más ordenada de todas las publicaciones fijadas por categoría, con los temas fijados globalmente en la parte superior:

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