Query per Data explorer per ottenere avvisi specifici dei post?

I post dei messaggi di avviso sono in realtà archiviati nella tabella post_custom_fields, quindi puoi ottenere un elenco più preciso dei post in questo modo:

-- [params]
-- int :days_ago = 7

SELECT p.created_at,
       p.id AS post_id,
       p.user_id,
       pcf.value AS "tipo di avviso"
FROM post_custom_fields pcf
INNER JOIN posts p ON pcf.post_id = p.id
INNER JOIN topics t ON p.topic_id = t.id
WHERE pcf.name = 'notice_type'
  AND p.created_at > NOW() - INTERVAL ':days_ago days'
  AND t.archetype = 'regular'
ORDER BY p.created_at ASC