Multiple tables joining [message #670076] |
Mon, 04 June 2018 01:40 |
|
suji6281
Messages: 145 Registered: September 2014
|
Senior Member |
|
|
Hi All,
Could you please help me with sql query on my below request.
I have multiple tables to join and it's required to return row even if any one of the tables have the data.
CREATE TABLE MYTBL1 ( EMPLID VARCHAR(10), NAME VARCHAR(30), ERROR VARCHAR(1), DESCR VARCHAR (40));
INSERT INTO MYTBL1 VALUES ('12367', 'JOHN' , 'Y', 'INVALID NAME');
CREATE TABLE MYTBL2 ( EMPLID VARCHAR(10), NAME VARCHAR(30), ERROR VARCHAR(1), DESCR VARCHAR (40));
INSERT INTO MYTBL2 VALUES ('45378', 'PETER' , 'N', ' ');
By joining those 2 tables I should get the output since one of table has ERROR field has 'Y'. with standard join it will not return any row. And I'm not sure outer joining will resolve my issue. Please help me with sql. Thank You.
Regards
Suji
|
|
|
|
|
|
|
|