Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of adding multiple pieces of data in sql

Shulou Source: shulou.com Published: 2022-06-01 19:44:20 10月02日 Update

Today, the editor shares with you the method of adding multiple pieces of data in sql. I believe many people do not know much about it. In order to let you know more about the method of adding multiple pieces of data in sql, I have summarized the following contents for you. Let's look down together. I'm sure you'll get something.

Sql adds multiple pieces of data:

Add a record

Insert into tableName (num1,num2,num3) values (1pm 2pm 3)

-- add multiple records ①

Insert into tableName (num1,num2,num3) select 3 union all 4 union all / / add all, including duplicates, do not add duplicates using union, the last item does not write unionselect 6 Magi 7 Jing 8

-- add multiple records ②

Insert into tableName (num1,num2,num3) values (1 ~ 2), (4 ~ 3), (1.23 ~ 9)

The above is a brief introduction to the method of adding multiple pieces of data in sql. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!

Tags: Multiple data methods different brief content that is more look industry information information channels face channels plus one Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi macOS Xiaomi Shulou Tech Info