select la.title as activity_title, la.item_id as activity_item_id, la.activity_id, la.complete_act_id from imsld_learning_activitiesi la where activity_id = :activity_id select sa.title as activity_title, sa.item_id as activity_item_id, sa.activity_id, sa.complete_act_id from imsld_support_activitiesi sa where sa.activity_id = :activity_id select title as activity_title, item_id as activity_item_id, structure_id, structure_type from imsld_activity_structuresi where structure_id = :activity_id select ar.object_id_two, ar.rel_type, ar.rel_id, ir.sort_order, case ar.rel_type when 'imsld_as_la_rel' then 'learning' when 'imsld_as_sa_rel' then 'support' when 'imsld_as_as_rel' then 'structure' else 'none' end as activity_type from acs_rels ar, imsld_activity_structuresi ias, (select * from imsld_as_la_rels union select * from imsld_as_sa_rels union select * from imsld_as_as_rels) as ir where ar.object_id_one = ias.item_id and ar.rel_id = ir.rel_id and ias.structure_id = :structure_id and content_item__get_live_revision(ar.object_id_two) is not null order by ir.sort_order, ar.object_id_two select structure_id, structure_type from imsld_activity_structuresi where item_id = :structure_item_id