Правильное решение. Но попробуй еще этот запрос, мне просто интересно:
select distinct pos_ptf_cod, pos_val_cod, first_value(pos_darr) over (partition by pos_ptf_cod, pos_val_cod order by pos_darr) mindate from position a where pos_darr < '20/07/2006' and not exists (select 1 from position where pos_ptf_cod = a.pos_ptf_cod and pos_val_cod = a.pos_val_cod and pos_darr >= a.pos_darr and pos_darr <= '20/07/2006' and pos_cours != a.pos_cours )
no subject
select distinct pos_ptf_cod, pos_val_cod, first_value(pos_darr) over
(partition by pos_ptf_cod, pos_val_cod order by pos_darr) mindate
from position a
where pos_darr < '20/07/2006'
and not exists
(select 1
from position
where pos_ptf_cod = a.pos_ptf_cod
and pos_val_cod = a.pos_val_cod
and pos_darr >= a.pos_darr
and pos_darr <= '20/07/2006'
and pos_cours != a.pos_cours
)