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!

Replace

00125Sep 20 2012 — edited Sep 20 2012
Hi all,

I have two tables like this
Table1
create table table1(code varcahr2(3),city_code varchar2(10));
/

Table 2
create table table2(city varchar2(50),offer_id number(10));
/

insert into table1 values('AAA','CCC')
/
insert into table1 values('BBB','DDD')
/
insert into table2 values('asd(CCC)asdf',1)
/
insert into table2 values('asd(DDD)asdf',1)
My reqirement is

1.compare table 2 column city values within(..) with table1 column city_code.

2.If it matched then update table2 column city within (..) with table1 column code.

Example.

asd(CCC)asdf here within() there is CCC this is matched with city_code CCC and it's resulting code is AAA.update it like as asd(AAA)asdf
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2012
Added on Sep 20 2012
5 comments
121 views