sample_user_queries
This is an old revision of the document!
Sample SQL queries
Messages that have a private note attached to them:
SELECT mail_id FROM notes
The last 20 messages that have a private note:
SELECT mail_id FROM notes ORDER BY mail_id DESC LIMIT 20
Messages that have a private note which has been added or modified during the last 7 days:
SELECT mail_id FROM notes WHERE last_changed>=now()-'7 days'::INTERVAL
sample_user_queries.1329516739.txt.gz · Last modified: 2012/02/17 22:12 by daniel