TransWikia.com

Appending columns from a table to my active table?

Geographic Information Systems Asked by MapsRus on May 14, 2021

I am trying to append three columns from srs2016 to srs2013_1 using this sql.

INSERT INTO srs2013_1 (the_geom, agency_responsible, description)
    SELECT             the_geom, agency_responsible, description
    FROM srs2016

The statement fail with this message:

Syntax error: column “agency_responsible” of relation “srs2013_1” does
not exist

I have tried adding quotes. Did not appear to help.

One Answer

INSERT INTO will add values from one table to another (not columns). Your query looks OK. Are you sure is not a typo? agency_responsible is well written? A workaround if the problem continues is using UNION ALL:

SELECT * FROM srs2013_1
UNION ALL
SELECT * FROM srs2016

I use * because I understand all columns are the same and they are ordered in the same way.

Answered by ramiroaznar on May 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP