proba haciendo una subconsulta en el select ... algo asi para que el ingreso y 
egreso los tome en el mismo registro

select
ing.tjt,
ing.fecha,
ing.hora,
ing.inout,
ing.fecha as egr_fecha,
(
 select max(egr.hora)
 from asistencia egr
 where 1=1
 and ing.tjt=egr.tjt
 and ing.fecha=egr.fecha
 and egr.inout="Egreso"
) as egr_hora,
"Egreso" as egr_inout
from asistencia ing
where 1=1
and ing.asistencia.inout="ingreso"
order by
ing.tjt,
ing.fecha,
ing.hora,
egr_fecha,
egr_hora

saludos
leandro
 

Responder a