Hi All,
I am trying to write a query to get output in specific format. I have 3 different table to get this data. I can get multiple rows but output should be based on B_TYPE and should return result in one row only.
I want out put to be look like
A_NUM B_FCODE as PCode C_Description as PDesc B_FCODE as CCode C_Description as CDesc B__FCode as RCode C_Description as RDesc
WA-1001 DRG Do rough gricing OTH Others NON No other noise
Below is DDL & DML for test data.
create table A
(
A_NUM VARCHAR2(20) ,
A_FCODE VARCHAR2(20)
);
INSERT INTO A VALUES ('WA-1001','DRG');
CREATE TABLE B
(
B_NUM VARCHAR2(20),
B_TYPE VARCHAR2(20),
B_FCODE VARCHAR2(20)
);
INSERT INTO B VALUES ('WA-1001','P','DRG');
INSERT INTO B VALUES ('WA-1001','C','OTH');
INSERT INTO B VALUES ('WA-1001','R','NON');
CREATE TABLE C
(
C_FCODE VARCHAR2(20),
C_DESCIPTION VARCHAR2(20)
);
INSERT INTO B VALUES ('DRG','Do rough gricing');
INSERT INTO B VALUES ('OTH', 'Others');
INSERT INTO B VALUES ('NON', 'No other noise');
Thanks in advance.
AR