Great idea @Mittineague !
I took your code and add some new code ![]()
I tested, works like a charm
--[params]
--string :interval = 1 week
--int :limit
SELECT id,
CONCAT('<a href = "/t/', id, '">', title, '</a>')
AS html$topic,
created_at as posted
FROM topics
WHERE age(created_at) < interval :interval
AND archetype != 'private_message'
GROUP BY id
ORDER BY created_at DESC
LIMIT :limit