Dino Geek, try to help you

How to insert multiple rows in a single query in MariaDB?


You can insert multiple rows in a single query in MariaDB by simply separating the data for each row with a comma.

Here is an example:

```
INSERT INTO table_name (column1, column2, column3, …)
VALUES
(value1, value2, value3, …),
(value1, value2, value3, …),
(value1, value2, value3, …);
```

This query will create a new row in `table_name` for each set of `values`. Each value corresponds to the column name provided in the paratheses after the `table_name`. Make sure the correct number and types of values are provided.

For example, if you have a table called `employees` that looks like this:

id name job\_position
—— ——— ———————
1 John Developer

And you want to insert two new employees:

You can use the following query:

```
INSERT INTO employees (id, name, job_position)
VALUES
(2, ‘Jane’, ‘HR Manager’),
(3, ‘Doe’, ‘Software Engineer’);
```

After running this query, your `employees` table would look like:

id name job\_position
—— ——— ———————-
1 John Developer
2 Jane HR Manager
3 Doe Software Engineer

Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use