postgresql7.2
SELECT
p.item_id,
p.project_id,
p.parent_id as folder_id,
p.object_type as content_type,
p.title as project_name,
p.project_code,
to_char(p.planned_start_date, 'MM/DD/YY') as planned_start_date,
to_char(p.planned_end_date, 'MM/DD/YY') as planned_end_date,
p.ongoing_p,
c.category_id,
c.category_name,
p.actual_hours_completed,
p.estimated_hours_total,
to_char(p.estimated_finish_date, 'MM/DD/YY') as estimated_finish_date,
to_char(p.earliest_finish_date, 'MM/DD/YY') as earliest_finish_date,
to_char(p.latest_finish_date, 'MM/DD/YY') as latest_finish_date
FROM pm_projectsx p LEFT JOIN (select om.category_id, om.object_id, t.name as category_name from category_object_map om, category_translations t where om.category_id = t.category_id) c ON p.item_id = c.object_id, cr_items i, pm_project_status s
WHERE p.project_id = i.live_revision and
p.parent_id = :root_folder and
s.status_id = p.status_id
[template::list::filter_where_clauses -and -name projects]
[template::list::orderby_clause -orderby -name projects]