Essays.club - Ensayos gratis, notas de cursos, notas de libros, tareas, monografías y trabajos de investigación
Buscar

SELECT XY.* FROM (

Enviado por   •  3 de Octubre de 2018  •  16.547 Palabras (67 Páginas)  •  215 Visitas

Página 1 de 67

...

(’-1’<>:version_prog AND

vseg.num_programa_contratacion in (select num_programa_contratacion from version_programa where anio_version_programa=:anio

AND version_zpar=:version_prog))

)

AND vseg.desc_centro_contratacion IN (:centro_contratante)

AND decode(vseg.subdireccion,’SSAP’,’SSE’,’UNP’,’PPS’,vseg.subdireccion) IN (:subdireccion)

) where recibido= 1

group by decode(recibido,1,’Recibidos’)

UNION ALL

SELECT DECODE(etapa,’NOTIFADJUDI’,’07’,orden) AS orden,

DECODE(etapa,’NOTIFADJUDI’,’EVALUACION’,etapa) AS cve_evento,

case when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’12’ then max(etapas.DESIERTO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’11’ then max(etapas.FORMALIZADO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’10’ then max(etapas.EN_FIRMA)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’09’ then max(etapas.EVALUACION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’08’ then max(etapas.JUNTACLA)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’07’ then max(etapas.PRECALIFICACION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’06’ then max(etapas.PUBLICACION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’05’ then max(etapas.EN_REVISION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’04’ then max(etapas.AUT_ORG_COLEGIADO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’03’ then max(etapas.ELAB_MODELO_CONTRATO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’02’ then max(etapas.ANALISIS_MERCADO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’01’ then max(etapas.PENDIENTE)

end cantidad,

case when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’12’ then 0

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’11’ then max(etapas.DESIERTO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’10’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’09’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’08’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’07’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’06’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)+max(etapas.PRECALIFICACION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’05’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)+max(etapas.PRECALIFICACION)+max(etapas.PUBLICACION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’04’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)+max(etapas.PRECALIFICACION)+max(etapas.PUBLICACION)+max(etapas.EN_REVISION)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’03’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)+max(etapas.PRECALIFICACION)+max(etapas.PUBLICACION)+max(etapas.EN_REVISION)+

max(etapas.AUT_ORG_COLEGIADO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’02’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)+max(etapas.PRECALIFICACION)+max(etapas.PUBLICACION)+max(etapas.EN_REVISION)+

max(etapas.AUT_ORG_COLEGIADO)+max(etapas.ELAB_MODELO_CONTRATO)

when DECODE(etapa,’NOTIFADJUDI’,’07’,orden)=’01’ then max(etapas.DESIERTO)+max(etapas.FORMALIZADO)+max(etapas.EN_FIRMA)+max(etapas.EVALUACION)+

max(etapas.JUNTACLA)+max(etapas.PRECALIFICACION)+max(etapas.PUBLICACION)+max(etapas.EN_REVISION)+

max(etapas.AUT_ORG_COLEGIADO)+max(etapas.ELAB_MODELO_CONTRATO)+max(etapas.ANALISIS_MERCADO)

end acumulado,

0 as gp_firma,

0 as mt_firma,

SUM (mn) mn,

SUM (usd) usd,

SUM (usm) usm,

0 opcion

FROM view_avance_contratacion vseg,

...

Descargar como  txt (45.8 Kb)   pdf (80 Kb)   docx (29.3 Kb)  
Leer 66 páginas más »
Disponible sólo en Essays.club