Advertisement
Guest User

Untitled

a guest
Jul 6th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. insert into mig_pres_catedras
  2. select c.id as codigo,
  3.     cd.id_sede,
  4.     0 as departamento,
  5.     c.id_materia as asignatura,
  6.     --(select COALESCE(df.id_resolucion,df.id_ordenanza) from cargos_funciones.docentes_funciones df where c.id=df.id_comision limit 1) as ordenanza,
  7.     r.numero as ordenanza,
  8.     horas_catedra as carga_horaria,
  9.     cpm.anio_cursado as anio,
  10.     case c.id_modalidad
  11.         when 1 then 'P'
  12.         when 2 then 'SP'
  13.     end as modalidad,
  14.    
  15.     cp.id_carrera,
  16.     horas_catedra as total_horas,
  17.     0 as total_clases,
  18.     case c.id_periodo_academico
  19.         when 1 then '1er Cuatrimestre'
  20.         when 2 then '2do Cuatrimestre'
  21.         when 3 then 'Anual'
  22.         when 4 then 'Semanal'
  23.     end as periodo_lectivo,
  24.     c.anio_academico as ciclo_lectivo,
  25.     0 as pasado
  26. from cargos_funciones.comisiones c
  27. inner join cargos_funciones.carreras_dictadas cd on (c.id_carrera_dictada=cd.id)
  28. inner join carreras.carreras_planes cp on (cd.id_carrera_plan = cp.id)
  29. left outer join carreras.carreras_planes_materias cpm on (cpm.id_carrera_plan = cd.id_carrera_plan and cpm.id_materia = c.id_materia)
  30. left outer join actos_administrativos.resoluciones r on (select COALESCE(df.id_resolucion,df.id_ordenanza) from cargos_funciones.docentes_funciones df where c.id=df.id_comision limit 1)=r.id
  31. where c.anio_academico = 2017 and c.id_periodo_academico = 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement