Discussion:
Oracle Sub Query "not in" issue
(too old to reply)
A***@gmail.com
2007-06-06 20:44:57 UTC
Permalink
Hello,

Is there any alternative query to the below one?

update RTable set Reason = 'XYZ'
Where FKey = 1234
and SFKey = 1
and Reason Is Null
and F_ID not in ( Select F_ID from RTable
Where FKey = 1234
and SFKey = 1
and TO_NUMBER(REL_CD) = 1
and Reason Is Null);

"not in" in the above query is taking alot of time and it is timing
out.

Please Advise.

Thanks
d***@gmail.com
2007-06-07 01:34:06 UTC
Permalink
Post by A***@gmail.com
Hello,
Is there any alternative query to the below one?
update RTable set Reason = 'XYZ'
Where FKey = 1234
and SFKey = 1
and Reason Is Null
and F_ID not in ( Select F_ID from RTable
Where FKey = 1234
and SFKey = 1
and TO_NUMBER(REL_CD) = 1
and Reason Is Null);
"not in" in the above query is taking alot of time and it is timing
out.
Please Advise.
Thanks
update rtable set reason = 'XYZ'
where rowid in (
select rowid from rtable
where fkey = 1234 and SFKEY = 1 and reason is null and rel_cd != 1
);

Continue reading on narkive:
Loading...