0

is it possible to reduce a multiple insert into in PostgreSQL.

i have this:

insert into table (id,name,city)
values ('1','Mike','Orleans')

insert into table (id,name,city)
values ('2','Paul','Paris')

so i have to insert more than 100 datas. Can we do it in one query

Thank you

1 Answer 1

1
insert into the_table (id,name,city)
values 
  (1,'Mike','Orleans'),
  (2,'Paul','Paris');

If id is an integer column, then don't provide a string value for it. '1' is a string (character) value. Numbers are specified without single quotes: 1 is a number.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.