R
R
Rolros2021-10-20 11:27:55
SQL
Rolros, 2021-10-20 11:27:55

How to compactly form an SQL query to the database?

There is a query that adds text to 1 line.

INSERT INTO
   zx_storm(product_id, text, date_added)
VALUES
   (57, "Дата добавления проверка", '2020-04-06 22:18:53');


How to make it so that in 1 sql query write several rows at once.
I try this but it doesn't work
INSERT INTO
   zx_storm(product_id, text, date_added)
VALUES
   (56, "Дата добавления проверка", '2020-04-06 22:18:53');
  (55, "Дата добавления проверка2", '2020-04-06 22:18:53');
  (54, "Дата добавления проверка3", '2020-04-06 22:18:53');
  (53, "Дата добавления проверка4", '2020-04-06 22:18:53');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ikutin666, 2021-10-20
@Rolros

INSERT INTO
   zx_storm(product_id, text, date_added)
VALUES
   (56, "Дата добавления проверка", '2020-04-06 22:18:53'),
  (55, "Дата добавления проверка2", '2020-04-06 22:18:53'),
  (54, "Дата добавления проверка3", '2020-04-06 22:18:53'),
  (53, "Дата добавления проверка4", '2020-04-06 22:18:53');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question