my new table where I want to insert the data has these columns:
gid,cvegeo,nom_ent,nom_mun,nom_loc,longitud,latitud,altitud,geom
the other 2 tables have 200 columns, between the columns of these are called the same as the new table the name of my tables are loc_urb_spheric
and loc_rur_spheric
. My new table has the same type of data of the columns that I want to take
this is my query which does not work:
INSERT INTO locaciones gid,cvegeo,nom_ent,nom_mun,nom_loc,longitud,latitud,altitud,geom FROM ( SELECT a.gid,a.cvegeo,a.nom_ent,a.nom_mun,a.nom_loc,
a.longitud,a.latitud,a.altitud,a.geom from loc_rur_spheric a UNION SELECT b.gid,b.cvegeo,b.nom_ent,b.nom_mun,b.nom_loc,
b.longitud,b.latitud,b.altitud,b.geom from loc_urb_spheric b );