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!

Join to mapping table

TomasRAug 27 2021 — edited Aug 27 2021

Hello Everyone,
please, could you advice me, how to join "Table 1" and "Mapping table" for "Results".
Thank you.
image.png
create table Table_1 (ID1 VARCHAR2(10 CHAR), ID2 VARCHAR2(10 CHAR));
insert into Table_1 values ('12','A');
insert into Table_1 values ('12','B');
insert into Table_1 values ('12','C');
insert into Table_1 values ('12','D');
insert into Table_1 values ('13','X');
insert into Table_1 values ('13','Y');
insert into Table_1 values ('14','Z');

create table Mapping_table_1 (ID1 VARCHAR2(10 CHAR), ID2 VARCHAR2(10 CHAR), CNTR VARCHAR(15 CHAR));
insert into Mapping_table_1 values ('12','A','one');
insert into Mapping_table_1 values ('12','B','two');
insert into Mapping_table_1 values ('12','%','three');
insert into Mapping_table_1 values ('13','%','four');

This post has been answered by Frank Kulash on Aug 27 2021
Jump to Answer
Comments
Post Details
Added on Aug 27 2021
7 comments
767 views