Go tool for reading original messages from DB and filling out contact table.
SQL scripts for building address book table from most commonly referenced
names per unique email address.
18 lines
227 B
SQL
18 lines
227 B
SQL
SELECT
|
|
count(f.path) AS Cnt,
|
|
f.hash AS Hash,
|
|
array_agg(distinct i.path) Paths
|
|
FROM
|
|
files AS f
|
|
INNER JOIN
|
|
files i
|
|
ON
|
|
i.hash = f.hash
|
|
GROUP BY
|
|
f.hash
|
|
HAVING
|
|
count(f.path)>1
|
|
ORDER BY
|
|
Cnt DESC
|
|
;
|