postgresql7.4 SELECT f.faculty_id, f.faculty_name, d.department_id, d.department_name, s.stream_name FROM cc_faculty f, cc_department d, cc_stream s WHERE f.faculty_id = d.faculty_id AND d.department_id = s.department_id AND s.stream_id = :stream_id AND s.package_id = :package_id SELECT map.map_id, n.uos_code, n.uos_name, uos.uos_id, rev.year_id, y.name, rev.core_id, map.live_revision_id, uosr.session_ids, uos.uos_name_id FROM cc_uos uos, cc_uos_revisions uosr, cc_stream_uos_map map, cc_stream_uos_map_rev rev, cc_year y, cc_uos_name n WHERE uos.uos_id = map.uos_id AND map.stream_id = :stream_id AND map.live_revision_id = rev.map_rev_id AND rev.year_id = y.year_id AND rev.year_id != 0 AND uos.live_revision_id = uosr.uos_revision_id AND n.name_id = uos.uos_name_id SELECT cc_session__name(:session_id) SELECT DISTINCT level FROM cc_uos_gradattr_set gas, cc_uos_gradattr_map gam, cc_uos_gradattr_name gan, cc_uos_gradattr ga WHERE gas.parent_uos_id = :uos_id AND gas.live_revision_id = gam.revision_id AND gam.gradattr_id = ga.gradattr_id AND ga.name_id = :gradattr_id SELECT name, name_id FROM cc_uos_gradattr_name