sample_user_queries
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
sample_user_queries [2012/10/05 01:24] – daniel | sample_user_queries [2014/07/22 13:15] – daniel | ||
---|---|---|---|
Line 25: | Line 25: | ||
SELECT m.mail_id FROM mail m WHERE msg_date> | SELECT m.mail_id FROM mail m WHERE msg_date> | ||
</ | </ | ||
+ | |||
+ | Messages that have a lot of recipients in the //To// field (example: more than 20) | ||
+ | <code sql> | ||
+ | SELECT mail_id FROM mail_addresses WHERE addr_type=2 GROUP BY mail_id having count(*)> | ||
+ | </ | ||
+ | |||
+ | Messages that have a lot of recipients in the //To// or //Cc// fields (example: more than 20) | ||
+ | <code sql> | ||
+ | SELECT mail_id FROM mail_addresses WHERE addr_type in (2,3) GROUP BY mail_id having count(*)> | ||
+ | </ | ||
+ | |||
+ | Messages for which any sender or recipient is from a given domain | ||
+ | <code sql> | ||
+ | select a.mail_id from mail_addresses a join addresses using(addr_id) where email_addr like ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | See the [[http:// | ||
sample_user_queries.txt · Last modified: 2014/08/04 11:23 by daniel