Si no he entendido mal, me parece que lo que apunta AgustinOrtu serviría. Yo incluiría dichas fechas en el resultado de la select
(select first 1 of.fecha_audita from oftalmologia of where of.idpaciente=p.idpaciente order by of.fecha_audita DESC)
y me construría una vista para poder manejarlo comodamente.
|