jotazetaec

Untitled

Oct 30th, 2025
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. select tc.nombre as congreso,
  2. case when tp.id_personal_sga is null
  3. then tpe.correo
  4. else p.correo_personal_institucional
  5. end as correo ,
  6. upper(case when tp.id_personal_sga is null
  7. then concat(tpe.nombres,' ', tpe.apellido1, ' ', tpe.apellido2)
  8. else concat(p.nombres,' ', p.apellido1, ' ', p.apellido2)
  9. end) as inscrito,
  10. case when tp.id_personal_sga is null
  11. then ug2.nombre
  12. else ug.nombre
  13. end as pais,
  14. tbi.nombre as institucion
  15. from esq_conv_2020.tbl_preinscripcion tp
  16. join esq_conv_2020.tbl_congreso tc on tp.id_congreso = tc.idregistro
  17. left join esq_conv_2020.tbl_banco_instituciones tbi on tbi.idregistro = tp.id_institucion
  18. left join esq_datos_personales.personal p on p.idpersonal = tp.id_personal_sga
  19. left join esq_conv_2020.tbl_personal_ext tpe on tpe.idregistro = tp.id_personal_tmp
  20. left join esq_catalogos.ubicacion_geografica ug on ug.idubicacion_geografica = p.idtipo_pais_origen
  21. left join esq_catalogos.ubicacion_geografica ug2 on ug2.idubicacion_geografica = tpe.pais_origen::numeric
  22. where tc.id_convencion = 11 and tc.idregistro = 139
  23. order by tc.nombre,inscrito;
Advertisement
Add Comment
Please, Sign In to add comment