postgresql7.1
select g.comment_id,
g.related_object_id as object_id,
r.title,
r.content,
r.mime_type as comment_mime_type,
acs_object__name(g.related_object_id) as object_name
from general_comments g,
cr_revisions r
where g.comment_id = :comment_id and
r.revision_id = coalesce(content_item__get_latest_revision(:comment_id),:revision_id)