Skip site navigation (1) Skip section navigation (2)

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

From: Sindile Bidla <sindile(dot)bidla(at)gmail(dot)com>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Create a new table from records not joined in a left outer join
Date: 2012-09-13 05:55:16
Message-ID: CA+fb49Z9J86n+bUPBy0JYseULgdZv_ruBL439cLyRZmjhLWnyg@mail.gmail.com (view raw or flat)
Thread:
Lists: 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.

Responses

pgsql-novice by date

Next:From: Jayadevan MDate: 2012-09-13 05:59:03
Subject: Re: Create a new table from records not joined in a left outer join
Previous:From: James David SmithDate: 2012-09-12 15:39:07
Subject: Interpolating Values

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group