select assessment_id from as_assessment_section_map where section_id = :section_id select latest_revision from cr_items where item_id = :assessment_id insert into as_assessment_section_map (select :new_assessment_id as assessment_id, section_id, max_time_to_complete, sort_order, points from as_assessment_section_map where assessment_id = :assessment_id) insert into category_object_map (select category_id, :to_id as object_id from category_object_map where object_id = :from_id) select section_id from as_session_sections where session_id = :session_id order by sort_order select m.section_id, r.title from as_assessment_section_map m, cr_revisions r where m.assessment_id = :assessment_id and r.revision_id = m.section_id order by m.sort_order insert into as_session_sections (session_id, section_id, sort_order) values (:session_id, :section_id, :count) select count(*) from cr_items where name = :name