Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- row_number() OVER () AS idregistro,
- u.id_periodo_evaluacion,
- u.n_periodo,
- u.facultad,
- u.idfacultad ,
- u.departamento,
- u.iddepartamento ,
- u.cedula,
- u.id_docente,
- u.correo_personal_institucional,
- u.docente,
- u.idcategoria,
- u.categoria,
- u.dedicacion,
- u.modalidad,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 1 ) as c1,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 2 ) as c2,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 3 ) as c3,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 4 ) as c4,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 5 ) as c5,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 6 ) as c6,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 7 ) as c7,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 8 ) as c8,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 9 ) as c9,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 10) as c10,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 11) as c11,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 12) as c12,
- AVG(tidr2.nota) FILTER (where tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente and tic.id_registro = 13) as c13
- FROM esq_evaluacion.mvdatacomp u
- join esq_evaluacion.tbl_int_detalle_resultado tidr2 on
- tidr2.id_periodo_evaluacion = u.id_periodo_evaluacion and tidr2.id_docente = u.id_docente
- join esq_evaluacion.tbl_int_preguntas tip on tip.idregistro = tidr2.id_pregunta
- join esq_evaluacion.tbl_int_competencias tic on tic.id_registro = tip.id_competencia
- where u.id_periodo_evaluacion in (2) --and u.id_docente = 19434
- group by u.id_periodo_evaluacion,
- u.n_periodo,
- u.facultad,
- u.idfacultad ,
- u.departamento,
- u.iddepartamento ,
- u.cedula,
- u.correo_personal_institucional,
- u.id_docente,
- u.docente,
- u.idcategoria,
- u.categoria,
- u.dedicacion,
- u.modalidad
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement