Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Tunnig Help Please
Try this. It's not pretty, but it'll make effective use of the indexes. If that's not fast enough, you may want to consider attacking it programmatically. Depends on what you need it for...
Good luck,
Michael J. Ort
--for inserts
select
'INSERT' operation
, cur.*
from
cur_month cur
where not exists(
select
'x'
from
pre_month pre
where pre.p_key = cur.p_key
)
UNION ALL
--for deletes
select
'DELETE' operation
, pre.*
from
pre_month pre
where not exists (
select
'x'
from
cur_month cur
where pre.p_key = cur.p_key
)
UNION ALL
--for updates
select
'UPDATE' operation
, cur.*
from
cur_month cur
pre_month pre
where pre.p_key = cur.p_key
and pre.row1 != cur.row1
and pre.row2 != cur.row2
. . .
In article <955235392.20888.0.nnrp-01.c2de4f17_at_news.demon.co.uk>,
"Mujahid Hamid" <mujahid_at_pharmco.demon.co.uk> wrote:
> Hi all,
>
>
>
>
>
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Apr 10 2000 - 00:00:00 CDT
![]() |
![]() |