Initial version of query showing messages without date field.

This commit is contained in:
Bill Thiede 2014-04-13 21:04:33 -07:00
parent 0bf4581af7
commit f8d299b287

31
pg/dateless.sql Normal file
View File

@ -0,0 +1,31 @@
/* Select all rows from left table which aren't in right table.
SELECT l.*
FROM t_left l
LEFT JOIN t_right r
ON r.value = l.value
WHERE r.value IS NULL
*/
/*
TODO Add another layer of JOINs to show the value where name='Received' for
the missing hashes. Maybe we can parse dates from there.
*/
SELECT
l.hash, r.value
FROM
original l
LEFT JOIN (
SELECT
hash,
value
FROM
search_header
WHERE
name = 'Date'
) r
ON
r.hash = l.hash
WHERE
r.hash IS NULL
;