Thread: Create a new table from records not joined in a left outer join

Create a new table from records not joined in a left outer join

From
Sindile Bidla
Date:
I have a query of a left outer join

CREATE TABLE table3
AS SELECT d.*, u.*
FROM  table1 d
LEFT OUTER JOIN table2 u
ON (d.id = u.sgno); 

What i would like to do within the same query is to be able to create a new table with all the records of table2 that are not joined to table1. 

Re: Create a new table from records not joined in a left outer join

From
Jayadevan M
Date:

I have a query of a left outer join

 

CREATE TABLE table3

AS SELECT d.*, u.*

FROM  table1 d

LEFT OUTER JOIN table2 u

ON (d.id = u.sgno); 

 

What i would like to do within the same query is to be able to create a new table with all the records of table2 that are not joined to table1. 

 

 

 

CREATE TABLE table3

AS SELECT d.*, u.*

FROM  table2 u

LEFT OUTER JOIN table1 d

ON (d.id = u.sgno)

where  d.id  IS NULL;

 

Regards,

Jayadevan



DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."