SQL INSERT INTO 语句
作者:会飞的
INSERT INTO 语句INSERT INTO 语句用于向表格中插入新的行。语法INSERTINTO表名称VALUES(值1,值2,....)我们也可以指定所要插入数据的列:INSERTINTOtable_name(列1,列2,...)VALUES(值1,值2,....)插入新的行"Persons" 表:LastNameFirstNameAddressCityCarterThomasChangan StreetBeijingSQL 语句:INSERTI
INSERT INTO 语句
INSERT INTO 语句用于向表格中插入新的行。
语法
INSERT INTO 表名称 VALUES (值1, 值2,....)
我们也可以指定所要插入数据的列:
INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....)
插入新的行
"Persons" 表:
LastName | FirstName | Address | City |
---|---|---|---|
Carter | Thomas | Changan Street | Beijing |
SQL 语句:
INSERT INTO Persons VALUES ('Gates', 'Bill', 'Xuanwumen 10', 'Beijing')
结果:
LastName | FirstName | Address | City |
---|---|---|---|
Carter | Thomas | Changan Street | Beijing |
Gates | Bill | Xuanwumen 10 | Beijing |
在指定的列中插入数据
"Persons" 表:
LastName | FirstName | Address | City |
---|---|---|---|
Carter | Thomas | Changan Street | Beijing |
Gates | Bill | Xuanwumen 10 | Beijing |
SQL 语句:
INSERT INTO Persons (LastName, Address) VALUES ('Wilson', 'Champs-Elysees')
结果:
LastName | FirstName | Address | City |
---|---|---|---|
Carter | Thomas | Changan Street | Beijing |
Gates | Bill | Xuanwumen 10 | Beijing |
Wilson | Champs-Elysees |
猜你喜欢
您可能感兴趣的文章:
- PHP初学者头疼问题总结
- php计数器的设计与实现
- php分页函数
- 从零开始 教你如何搭建Discuz!4.1论坛(图)
- Php部分常见问题总结
- php正则
- 使用Apache的rewrite技术
- python r.hgetall获取所有值
- Unexpected character (< (code 60)): expected a valid value (number, String, array, object, true, false or null)
- Linux性能命令
- phpstorm requisted without authorization
- The following untracked working tree files would be overwritten by checkout
- SQL 简介
- SQL 语法
- SQL SELECT 语句
- SQL SELECT DISTINCT 语句
- SQL WHERE 子句
- SQL AND & OR 运算符
- SQL ORDER BY 子句