Robert James wrote
> I would like to:
>
> INSERT INTO t
> SELECT * FROM r, (x + y) AS field3
>
> How do I correlate the names of the fields? That is, how do I indicate
> which fields from r or field3 should be inserted into the right
> columns in t?
Already answered but I'll add that as written,
On Thu, Aug 22, 2013 at 6:36 PM, Ian Lawrence Barwick wrote:
> INSERT INTO t (t_field1, t_field2, t_field3)
> SELECT r.field1, r.field2, (x+y)
> FROM r
>
Obligatory link to documentation:
http://www.postgresql.org/docs/9.2/static/sql-insert.html. See where it
says [ ( *column_name* [, ...]
2013/8/23 Robert James :
> I would like to:
>
> INSERT INTO t
> SELECT * FROM r, (x + y) AS field3
>
> How do I correlate the names of the fields? That is, how do I indicate
> which fields from r or field3 should be inserted into the right
> columns in t?
INSERT INTO t (t_field1, t_field2, t_field
On Thu, Aug 22, 2013 at 3:30 PM, Robert James wrote:
> I would like to:
>
> INSERT INTO t
> SELECT * FROM r, (x + y) AS field3
>
INSERT INTO t (col1, col2, col3)
SELECT ...
I would like to:
INSERT INTO t
SELECT * FROM r, (x + y) AS field3
How do I correlate the names of the fields? That is, how do I indicate
which fields from r or field3 should be inserted into the right
columns in t?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make c