Haven't been following this thread too closely but I think that *maybe* the
following code could help:

Create view Qtemp.Insert_dta as
With t1 as(
select q1.*, rrn(q1) as rrn_q1 from qtemp.quote q1 )
Select t1.* from t1
where not exists(
Select 1 from qtemp.quote q2
where rrn(q2) > t1.rrn_q1
AND t1.qtvend = q2.qtvend
and (
(t1.qtdtef between q2.qtdtef and q2.qtdtex) OR
(t1.QTDTEX between q2.qtdtef and q2.qtdtex)

It should be a little slow. Having the appropriate indexes should help a

Just INSERT the columns you need.

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page