Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select tc.nombre as congreso,
- case when tp.id_personal_sga is null
- then tpe.correo
- else p.correo_personal_institucional
- end as correo ,
- upper(case when tp.id_personal_sga is null
- then concat(tpe.nombres,' ', tpe.apellido1, ' ', tpe.apellido2)
- else concat(p.nombres,' ', p.apellido1, ' ', p.apellido2)
- end) as inscrito,
- case when tp.id_personal_sga is null
- then ug2.nombre
- else ug.nombre
- end as pais,
- tbi.nombre as institucion
- from esq_conv_2020.tbl_preinscripcion tp
- join esq_conv_2020.tbl_congreso tc on tp.id_congreso = tc.idregistro
- left join esq_conv_2020.tbl_banco_instituciones tbi on tbi.idregistro = tp.id_institucion
- left join esq_datos_personales.personal p on p.idpersonal = tp.id_personal_sga
- left join esq_conv_2020.tbl_personal_ext tpe on tpe.idregistro = tp.id_personal_tmp
- left join esq_catalogos.ubicacion_geografica ug on ug.idubicacion_geografica = p.idtipo_pais_origen
- left join esq_catalogos.ubicacion_geografica ug2 on ug2.idubicacion_geografica = tpe.pais_origen::numeric
- where tc.id_convencion = 11 and tc.idregistro = 139
- order by tc.nombre,inscrito;
Advertisement
Add Comment
Please, Sign In to add comment