当前位置: 首页 > 网络学院 > 服务端脚本教程 > SQL > SQL Insert
The INSERT INTO statement is used to insert new rows into a table.
INSERT INTO 声明可以向数据表插入新的数据行
INSERT INTO table_name |
You can also specify the columns for which you want to insert data:
你也可以给指定栏目插入指定的数据:
INSERT INTO table_name (column1, column2,...) |
“Persons”表:
LastName | FirstName | Address | City |
---|---|---|---|
Pettersen | Kari | Storgt 20 | Stavanger |
SQL语句:
INSERT INTO Persons |
得到结果为:
LastName | FirstName | Address | City |
---|---|---|---|
Pettersen | Kari | Storgt 20 | Stavanger |
Hetland | Camilla | Hagabakka 24 | Sandnes |
“Persons”表:
LastName | FirstName | Address | City |
---|---|---|---|
Pettersen | Kari | Storgt 20 | Stavanger |
Hetland | Camilla | Hagabakka 24 | Sandnes |
SQL语句:
INSERT INTO Persons (LastName, Address) |
得到结果为:
LastName | FirstName | Address | City |
---|---|---|---|
Pettersen | Kari | Storgt 20 | Stavanger |
Hetland | Camilla | Hagabakka 24 | Sandnes |
Rasmussen | Storgt 67 |