mysql sql语句---增删改 insert、delete、update
2017-07-30 20:19
716 查看
insert
1)插入一行 insert into customers values(null,'pep','100 street','los angeles','ca','90046','usa',null,null); 依赖表中列的定义次序!
insert into customers(cust_name, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email) 更安全的方法
values('pep','100 street','los angeles','ca','90046','usa',null,null)
insert into customers(cust_name, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
values('pep','100 street','los angeles','ca','90046','usa',null,null),
('pep','100 street','new york','ca','1111','usa',null,null)
一次插入多组,每组值用一个圆括号扩起来,用逗号隔开。
update
由三部分组成:1要更新的表;2列名和他们的值;3 确定要更新行的过滤条件
update customers
set cust_email='10029@qq.com'
where cust_id=1005;
delete
delete from customers
where cust_id=1006;
21章-30章没看
1)插入一行 insert into customers values(null,'pep','100 street','los angeles','ca','90046','usa',null,null); 依赖表中列的定义次序!
insert into customers(cust_name, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email) 更安全的方法
values('pep','100 street','los angeles','ca','90046','usa',null,null)
insert into customers(cust_name, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email)
values('pep','100 street','los angeles','ca','90046','usa',null,null),
('pep','100 street','new york','ca','1111','usa',null,null)
一次插入多组,每组值用一个圆括号扩起来,用逗号隔开。
update
由三部分组成:1要更新的表;2列名和他们的值;3 确定要更新行的过滤条件
update customers
set cust_email='10029@qq.com'
where cust_id=1005;
delete
delete from customers
where cust_id=1006;
21章-30章没看
相关文章推荐
- 根据表名自动生成INSERT,UPDATE,DELETE,SELECT的SQL语句
- MySQL INSERT/UPDATE/DELETE语句高级用法
- T-SQL入门(三)——增删改(INSERT、DELETE、UPDATE)
- delphi学习SQL语句 - Insert、Update、Delete
- 如何在mybatis中一个insert,delete,update中执行多条SQL语句
- 学习 SQL 语句 - Insert、Update、Delete
- SQL SERVER insert/delete/update 中的 ouput语句
- SQL语句复习:insert,update,delete,select
- LINQ to SQL 语句之Insert/Update/Delete 操作
- QtCreator Qt中执行SQL语句,select,update,delete,insert
- 掌握SQL四条最基本的数据操作语句:Insert,Select,Update和Delete
- SQL语句复习:insert,update,delete,select
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- orcl sql语句笔记(select成功,update/delete/insert失败问题)
- SQL映射语句文件---3.2: insert,update,delete
- MYSQL INSERT UPDATE DELETE 语句
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- MYSQL学习笔记----表的insert、update、delete语句
- SQL Server 2008中SQL增强之三:Merge(在一条语句中使用Insert,Update,Delete)
- 根据表名自动生成INSERT,UPDATE,DELETE,SELECT的SQL语句