List all open PMs

List all open PMs

sorted by recent activity

SELECT
  t.id AS topic_id, 
  t.user_id 
FROM
  topics t 
  JOIN posts p ON t.id = p.topic_id 
WHERE
  t.archetype = 'private_message' 
  AND t.user_id > 0 
  AND t.reply_count > 1 
  AND NOT t.closed 
GROUP BY
  t.id 
ORDER BY
  t.updated_at DESC
4 Likes