postgresql7.1
select
n.template_demo_note_id,
n.title,
n.color,
to_char(o.creation_date, 'HH12:MI Month DD, YYYY') as creation_date,
p.first_names || ' ' || p.last_name as creation_user_name
from
template_demo_notes n,
acs_objects o,
persons p
where n.template_demo_note_id = o.object_id
and o.creation_user = p.person_id
and acs_permission__permission_p(template_demo_note_id, :user_id, 'read')