Advertisement
jotazetaec

Untitled

Oct 23rd, 2023
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select tc.nombre as congreso, tcl.nombre_area as tematica, tp.tema ,
  2. case when tpa.id_personal_sga is null
  3. then concat(tpe.nombres,' ', tpe.apellido1, ' ', tpe.apellido2)
  4. else concat(p.nombres,' ', p.apellido1, ' ', p.apellido2)
  5. end as autor,
  6. case when tpa.id_personal_sga is null
  7. then tpe.correo
  8. else p.correo_personal_institucional
  9. end as correo, case when tpa.id_personal_sga is null
  10. then ug2.nombre
  11. else ug.nombre
  12. end as pais,
  13. case when tpa.id_personal_sga is null
  14. then p.telefono_personal_celular  
  15. else tpe.telefono_movil
  16. end as celular
  17. from esq_conv_2020.tbl_ponencias tp
  18. join esq_conv_2020.tbl_congreso_linea tcl on tcl.idregistro = tp.id_congreso_linea
  19. join esq_conv_2020.tbl_congreso tc on tc.idregistro = tcl.id_congreso
  20. join esq_conv_2020.tbl_ponencias_autores tpa on tpa.id_ponencia = tp.idregistro
  21. left join esq_datos_personales.personal p on p.idpersonal = tpa.id_personal_sga
  22. left join esq_conv_2020.tbl_personal_ext tpe on tpe.idregistro = tpa.id_personal_tmp
  23. left join esq_catalogos.ubicacion_geografica ug on ug.idubicacion_geografica = p.idtipo_pais_origen
  24. left join esq_catalogos.ubicacion_geografica ug2 on ug2.idubicacion_geografica = tpe.pais_origen::numeric
  25. where tp.id_estado in(47,48,45)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement