postgresql7.4 SELECT s.name AS section_name, s.description AS section_desc, t.name AS template_name FROM lrc_section s, lrc_template t WHERE s.section_id = :section_id AND s.template_id = t.template_id AND s.package_id = :package_id SELECT resource_id, name AS resource_name, url AS resource_url, description AS resource_desc FROM lrc_resource WHERE section_id = :section_id AND package_id = :package_id ORDER BY resource_id ASC