select cct.*, cr.title, cr.description from contact_complaint_tracking cct, cr_items ci, cr_revisions cr where ci.latest_revision = cct.complaint_id and cr.revision_id = cct.complaint_id [template::list::filter_where_clauses -and -name complaint] select distinct cct.customer_id as c_id, cct.supplier_id as s_id, ( select first_names ||' '|| last_name from cc_users where user_id = customer_id) as customer, ( select first_names ||' '|| last_name from cc_users where user_id = supplier_id) as supplier from contact_complaint_tracking cct select title, description from cr_revisions where revision_id = :complaint_id