Subject Re: derived table within EXISTS (was: Different performance Superserver VS. Embeded ?)
Author danyschaer
Hi Set,

Well, I thougth about how selective is MOVI.PROC so I did a few tests
adding the "distinct" clause, even with your approach, but same results:

select p.PROC, p.EXP1 as EXPE, p.ACTO, p.DEMA, p.OBSE, t.DSCR as D_TPRO
from PROC p
left join TPRO t on p.TPRO=t.TPRO
where exists(select distinct PROC from MOVI m
where p.PROC = m.PROC
and m.TIPO = 'B')
order by lower(p.ACTO)

Dany