postgresql
7.3
SELECT
t.item_id,
t.revision_id,
i.live_revision,
t.title as task_title,
t.description || ' -- ' || p.first_names || ' ' || p.last_name
as description,
t.mime_type,
to_char(t.end_date,'MM/DD/YYYY') as end_date,
t.percent_complete,
t.estimated_hours_work_min,
t.estimated_hours_work_max,
t.actual_hours_worked
FROM
pm_tasks_revisionsx t, cr_items i, persons p
WHERE
t.item_id = :task_id and
t.item_id = i.item_id and
t.creation_user = p.person_id
and exists (select 1 from acs_object_party_privilege_map ppm
where ppm.object_id = t.item_id
and ppm.privilege = 'read'
and ppm.party_id = :user_id)
ORDER BY
t.revision_id asc