email/pg/list-ids.sql

14 lines
214 B
SQL

SELECT
COUNT(value),
SUBSTRING(value from '(.*)<') AS name,
COALESCE(SUBSTRING(value from '<(.*)>'), value) AS id
FROM
header
WHERE
name = 'List-Id'
GROUP BY
value
ORDER BY
count DESC
;