Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update with correlated subquery

407706Feb 5 2004 — edited Feb 7 2004
Hi,

I have the following SQL update statement:

update temp_input_sms b
set (b.provider_id,b.region_id)=
(select provider_id,region_id
from
(
select a.PROVIDER_ID,a.REGION_ID,row_number() over (order by fraud) rn
from icdm.smsc_lookup a
where sysdate>=a.VALID_FROM and sysdate<a.VALID_TO
and b.user_summarisation like a.SMSC_CODE_LIKE
) where rn=1)

The problem is that there are two nested subqueries on the right side of the set clause, and in the inner subquery the 'b.user_summarisation' column is not available.

Could anyone suggest a workaround for this problem?

Thanks.

Viktor
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2004
Added on Feb 5 2004
3 comments
350 views