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

Поиск
Список
Период
Сортировка
От Jayadevan M
Тема Re: Create a new table from records not joined in a left outer join
Дата
Msg-id 3411BBAFF5A2244FA405CC91D9473A609B4F95@PBOX2.ibsplc.com
обсуждение исходный текст
Ответ на Create a new table from records not joined in a left outer join  (Sindile Bidla <sindile.bidla@gmail.com>)
Список pgsql-novice

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."

В списке pgsql-novice по дате отправления:

Предыдущее
От: Sindile Bidla
Дата:
Сообщение: Create a new table from records not joined in a left outer join
Следующее
От: Matthew Foster
Дата:
Сообщение: Question about join