SQL学习—INSERT、UPDATE、DELETE语句
2017-10-03 21:09
549 查看
SQL之INSERT、UPDATE、DELETE总结
一、数据插入
1、插入完整行INSERT INTO Cusomers VALUES('100006','Toy Land','123 Any Street','New York','NY','1111',NULL,NULL); INSERT INTO Cusomers (cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip,cust_contact,cust_email) VALUES('100006','Toy Land','123 Any Street','New York','NY','1111',NULL,NULL);
2、插入部分行
INSERT INTO Cusomers (cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip) VALUES('100006','Toy Land','123 Any Street','New York','NY','1111')
3、插入检索出的数据
INSERT INTO Cusomers (cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip) SELECT cust_id,cust_name,cust_address,cust_city,cust_state,cust_zip FROM CustNew
4、从一个表复制到另一个表(要想只复制部分列,可以明确给出列名)
SELECT * INTO CustCopy FROM Customers
二、更新数据
UPDATE Customers SET cust_contact='Sam Reberts',cust_email='sam@toyland.com' WHERE cust_id='1000006'
三、删除数据
DELET FROM Customers WHERE cust_id='1000006'
相关文章推荐
- 学习 SQL 语句 - Insert、Update、Delete
- 学习 SQL 语句 - Insert、Update、Delete
- delphi学习SQL语句 - Insert、Update、Delete
- Oracle学习9:update、delete from、insert语句详解
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- SQL语句复习:insert,update,delete,select
- 如何在mybatis中一个insert,delete,update中执行多条SQL语句
- MYSQL学习笔记----表的insert、update、delete语句
- SQL语句复习:insert,update,delete,select
- 如何在mybatis中一个insert,delete,update中执行多条SQL语句
- 执行SQL语句---INSERT/UPDATE/DELETE
- 根据表名自动生成INSERT,UPDATE,DELETE,SELECT的SQL语句
- 掌握SQL四条最基本的数据操作语句:Insert,Select,Update和Delete
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- 根据表名自动生成INSERT,UPDATE,DELETE,SELECT的SQL语句
- 根据表名自动生成INSERT,UPDATE,DELETE,SELECT的SQL语句
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- Oracle中5个核心Sql语句的基本构造:Select、Insert、Update、Delete和Merge
- SQL 学习笔记<二> INSERT, UPDATE, DELETE, SELECT