postgresql7.1
select header_subject as title,
to_char(send_date, 'yyyy-mm-dd') as send_date,
to_char(send_date, 'hh24:mi:ss') as send_time,
sql_query, sent_p, content_item_id
from spam_messages_all
where spam_id = :spam_id
select cr.content as plain_text
from acs_mail_multipart_parts mpp
join cr_items ci on mpp.content_item_id=ci.item_id
join cr_revisions cr on ci.live_revision=cr.revision_id
where multipart_id=:content_item_id and cr.mime_type='text/plain';
select cr.content as html_text
from acs_mail_multipart_parts mpp
join cr_items ci on mpp.content_item_id=ci.item_id
join cr_revisions cr on ci.live_revision=cr.revision_id
where multipart_id=:content_item_id and cr.mime_type='text/html';
select content, mime_type
from cr_revisions
where revision_id = content_item__get_live_revision(:content_item_id)