SELECT p.item_id FROM pm_projectsx p WHERE p.project_id = :project_id SELECT p.project_id FROM pm_projectsx p, cr_items i WHERE p.item_id = :item_id and p.revision_id = i.live_revision SELECT p.item_id, p.project_id, p.title as project_name, p.project_code, p.goal, p.description, p.deadline_scheduling, to_char(p.planned_start_date,'MM/DD/YYYY') as planned_start_date, to_char(p.planned_end_date,'MM/DD/YYYY') as planned_end_date, p.ongoing_p, i.live_revision, p.estimated_completion_date, p.earliest_completion_date, p.latest_completion_date, p.estimated_hours_total FROM pm_projectsx p, cr_items i WHERE p.item_id = :item_id and p.project_id = :project_id and p.item_id = i.item_id SELECT p.item_id, p.project_id, p.title as project_name, p.project_code, p.goal, p.description, p.deadline_scheduling, to_char(p.planned_start_date,'MM/DD/YYYY') as planned_start_date, to_char(p.planned_end_date,'MM/DD/YYYY') as planned_end_date, p.ongoing_p, i.live_revision, p.estimated_completion_date, p.earliest_completion_date, p.latest_completion_date, p.estimated_hours_total FROM pm_projectsx p, cr_items i WHERE p.item_id = :item_id and p.item_id = i.item_id ORDER BY p.project_id desc SELECT t.item_id, t.title, to_char(t.end_date,'MM/DD/YY') as end_date, t.percent_complete, c.parent_task_id, c.const_type, t.estimated_hours_work_min, t.estimated_hours_work_max, t.actual_hours_worked, c.const_type FROM pm_tasks_revisionsx t, cr_items i LEFT JOIN pm_task_constraints c ON i.item_id = c.task_id WHERE t.parent_id = :item_id and t.revision_id = i.live_revision ORDER BY t.end_date,t.title