postgresql7.1 select s.survey_id, s.name, s.editable_p, s.single_response_p, sub.response_id, to_char(sub.creation_date,'Month FMDD, YYYY') as creation_date from surveys s left outer join (select creation_date, survey_id, response_id from survey_responses sr, acs_objects o where o.creation_user=:user_id and o.object_id=sr.response_id ) sub on (s.survey_id=sub.survey_id) where s.package_id=:package_id and s.enabled_p='t' and 't' = acs_permission__permission_p(s.survey_id, :user_id, 'write') order by upper(s.name), creation_date desc