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!

Left join using string concatenation

793686Sep 14 2010 — edited Sep 14 2010
hi

I have two tables and i want to join them using left join based on string concatenation as per limitation of my application i can only use it after where clause like below

create table shav_test1 (idd varchar(20), sec int, qty float )


insert into shav_test1 values ('1aa',2,100);
insert into shav_test1 values ('1bb',3,100);
insert into shav_test1 values ('1cc',4,100);
insert into shav_test1 values ('1dd',5,100);
insert into shav_test1 values ('2ee',2,100);
insert into shav_test1 values ('3ff',2,100);
insert into shav_test1 values ('4gg',2,100);

create table shav_test2 (id1 varchar(10),id2 varchar(10), sec int, qty float )

insert into shav_test2 values ('1','aa',2,100);
insert into shav_test2 values ('2','ee',2,100);
insert into shav_test2 values ('3','cc',2,100);
insert into shav_test2 values ('1','dd',5,100);

select * from shav_test1 s1, shav_test2 s2 where
s1.idd=(s2.id1||id2)(+)

I am getting error using above sql.

Please help
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2010
Added on Sep 14 2010
6 comments
4,384 views