Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DROP VIEW esq_ceac_planclase.v_syllabus_informacion_docente_bibliografia;
- CREATE OR REPLACE VIEW esq_ceac_planclase.v_syllabus_informacion_docente_bibliografia AS
- SELECT DISTINCT row_number() OVER ()::numeric AS idregistro,
- tbl_syllabus.tipo_materia,
- tbl_syllabus.id_periodo_academico,
- tbl_syllabus.codigo,
- materia_unica.nombre AS nombremateria,
- concat(tbl_syllabus_docente_informacion.apellido1, ' ', tbl_syllabus_docente_informacion.apellido2, ' ', tbl_syllabus_docente_informacion.nombres) AS nombredocente,
- tbl_syllabus_docente_informacion.titulo_cuarto_nivel,
- tbl_syllabus_mallas.id_escuela,
- tbl_syllabus_mu_departamentos.id_departamento,
- ( SELECT array_to_string(array_agg(concat(bbl.autor, ', ', bbl.titulo, ', ', bbl.anio, '.')), '|<BR>'::text) AS bibliografia_b
- FROM esq_ceac_planclase.tbl_programas_bibliografias bbl
- WHERE bbl.idprograma = tbl_syllabus.id_programa_analitico AND bbl.tipo ~~ '%B%'::text) AS bibliografia_b,
- ( SELECT array_to_string(array_agg(concat(bbl.autor, ', ', bbl.titulo, ', ', bbl.anio, '.')), '|<BR>'::text) AS bibliografia_c
- FROM esq_ceac_planclase.tbl_programas_bibliografias bbl
- WHERE bbl.idprograma = tbl_syllabus.id_programa_analitico AND bbl.tipo ~~ '%C%'::text) AS bibliografia_c,
- escuela.nombre AS nombreescuela,
- departamento.nombre AS nombredepartamento
- FROM esq_ceac_planclase.tbl_syllabus
- JOIN esq_distributivos.materia_unica ON tbl_syllabus.id_materia = materia_unica.idmateria_unica
- JOIN esq_ceac_planclase.tbl_syllabus_docente_informacion ON tbl_syllabus.idregistro = tbl_syllabus_docente_informacion.id_syllabus
- LEFT JOIN esq_ceac_planclase.tbl_syllabus_mallas ON tbl_syllabus.idregistro = tbl_syllabus_mallas.id_syllabus
- LEFT JOIN esq_ceac_planclase.tbl_syllabus_mu_departamentos ON tbl_syllabus.idregistro = tbl_syllabus_mu_departamentos.id_syllabus
- LEFT JOIN esq_inscripciones.escuela ON tbl_syllabus_mallas.id_escuela = escuela.idescuela
- LEFT JOIN esq_distributivos.departamento ON tbl_syllabus_mu_departamentos.id_departamento = departamento.iddepartamento
- GROUP BY tbl_syllabus.tipo_materia, tbl_syllabus.id_periodo_academico, tbl_syllabus.codigo, materia_unica.nombre, tbl_syllabus_docente_informacion.apellido1, tbl_syllabus_docente_informacion.apellido2, tbl_syllabus_docente_informacion.nombres, tbl_syllabus_docente_informacion.titulo_cuarto_nivel, tbl_syllabus_mallas.id_escuela, tbl_syllabus_mu_departamentos.id_departamento, (( SELECT array_to_string(array_agg(concat(bbl.autor, ', ', bbl.titulo, ', ', bbl.anio, '.')), '|<BR>'::text) AS bibliografia_b
- FROM esq_ceac_planclase.tbl_programas_bibliografias bbl
- WHERE bbl.idprograma = tbl_syllabus.id_programa_analitico AND bbl.tipo ~~ '%B%'::text)), (( SELECT array_to_string(array_agg(concat(bbl.autor, ', ', bbl.titulo, ', ', bbl.anio, '.')), '|<BR>'::text) AS bibliografia_c
- FROM esq_ceac_planclase.tbl_programas_bibliografias bbl
- WHERE bbl.idprograma = tbl_syllabus.id_programa_analitico AND bbl.tipo ~~ '%C%'::text)), escuela.nombre, departamento.nombre
- ORDER BY (row_number() OVER ()::numeric);
- ALTER TABLE esq_ceac_planclase.v_syllabus_informacion_docente_bibliografia
- OWNER TO ceac_analitico;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement