how to insert into the sql Where Insert postgres

Asked

Viewed 242 times

1

I am entering data in a table in postgres, it happens that I have a fields that do not exist in the referenced table and then the error when trying to insert a record that does not exist. I need to put a where...

INSERT INTO sexo(id,censo,sexo)
SELECT  "SEXO","CENSO","ABREV"
FROM dblink('dbname=censos2001 host=localhost user=postgres password=admin' ::text,'SELECT   "SEXO","CENSO","ABREV" FROM "SEXO"' ::text,false) 
as tabela_temp("SEXO" varchar, "CENSO" varchar ,"ABREV" character varying)
  • 1

    THIS RESOLVED I ADDED A WHERE AT THE END

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.