How to INSERT INTO one table from another table, WHERE - Mailing list pgsql-general

From Kirk Wythers
Subject How to INSERT INTO one table from another table, WHERE
Date
Msg-id C9FB8B33-B651-4EAF-91E4-EF75EE9A5B84@umn.edu
Whole thread Raw
Responses Re: How to INSERT INTO one table from another table, WHERE
List pgsql-general
I am trying to insert data from 2 columns in tableB (colX and colY) into the same two columns of tableB, with a join
likewhere clause. Is this possible?  

For example:

INSERT INTO tableA (colX, colY)
(SELECT colX, colY
FROM tableB
WHERE
    tableA.blockname = tableB.block_name
    AND tableA.timestamp = tableB.timestamp)
;




pgsql-general by date:

Previous
From: Yuriy Rusinov
Date:
Subject: Re: SPI_execute_with_args call
Next
From: Igor Neyman
Date:
Subject: Re: How to INSERT INTO one table from another table, WHERE