Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select tc.nombre as congreso, tcl.nombre_area as tematica, tp.tema ,
- case when tpa.id_personal_sga is null
- then concat(tpe.nombres,' ', tpe.apellido1, ' ', tpe.apellido2)
- else concat(p.nombres,' ', p.apellido1, ' ', p.apellido2)
- end as autor,
- case when tpa.id_personal_sga is null
- then tpe.correo
- else p.correo_personal_institucional
- end as correo, case when tpa.id_personal_sga is null
- then ug2.nombre
- else ug.nombre
- end as pais,
- case when tpa.id_personal_sga is null
- then p.telefono_personal_celular
- else tpe.telefono_movil
- end as celular
- from esq_conv_2020.tbl_ponencias tp
- join esq_conv_2020.tbl_congreso_linea tcl on tcl.idregistro = tp.id_congreso_linea
- join esq_conv_2020.tbl_congreso tc on tc.idregistro = tcl.id_congreso
- join esq_conv_2020.tbl_ponencias_autores tpa on tpa.id_ponencia = tp.idregistro
- left join esq_datos_personales.personal p on p.idpersonal = tpa.id_personal_sga
- left join esq_conv_2020.tbl_personal_ext tpe on tpe.idregistro = tpa.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 tp.id_estado in(47,48,45)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement