update 三种更新用法
来源:互联网 发布:图片改字用什么软件 编辑:程序博客网 时间:2024/05/16 15:33
1、set一个字段
在表t_test中设置第二条记录(bs为2)的password为'***'。
update t_test t
set t.password = '***'
where t.bs = 2;
2、set多个字段
在表t_test中设置第一条记录(bs为1)的password为'*'、remark为'*'。
update t_test t
set t.password = '*', t.remark = '*'
where t.bs = 1;
3、set null值
在表t_test中设置第三条记录(bs为3)的password为null、remark为null。
update t_test t
set t.password = null, t.remark = null
where t.bs = 3;
这个是按照标准语法写的,在不同的数据库系统中,update还有更多的写法,但是标准写法都是支持的。以上三个例子为了说明情况,每次都更新一行。在实际中,可以通过where语句约束来控制更新行数。
在表t_test中设置第二条记录(bs为2)的password为'***'。
update t_test t
set t.password = '***'
where t.bs = 2;
2、set多个字段
在表t_test中设置第一条记录(bs为1)的password为'*'、remark为'*'。
update t_test t
set t.password = '*', t.remark = '*'
where t.bs = 1;
3、set null值
在表t_test中设置第三条记录(bs为3)的password为null、remark为null。
update t_test t
set t.password = null, t.remark = null
where t.bs = 3;
这个是按照标准语法写的,在不同的数据库系统中,update还有更多的写法,但是标准写法都是支持的。以上三个例子为了说明情况,每次都更新一行。在实际中,可以通过where语句约束来控制更新行数。
- update 三种更新用法
- Update语句更新多表时在SQL Server,Oracle,MySQL三种数据库中的用法
- 标准SQL的update语句三种用法
- 标准SQL的update语句三种用法
- 标准SQL的update语句三种用法【转】
- 标准SQL的update语句三种用法
- SQL语句中UPDATE的三种用法
- 标准SQL的update语句三种用法
- 标准SQL的update语句三种用法
- 多表关联更新,UPDATE FROM用法
- MYSQL UPDATE LIMIT 更新限制语句用法
- 表的三种基本操作:插入(insert)、删除(delete)、更新(update)
- update更新
- mysql update limit mysql更新限制语句用法
- 数据库存更新(update 语句)用法(转)
- SQL UPDATE 更新数据用法之多表查询
- update 用法
- Android线程的三种用法和子线程更新UI两种用法
- 操作系统上的堆栈——极品解释
- Android Developers:保存键-值对
- OCP-1Z0-052-V8.02-96题
- oracle高级查询之连接查询、集合运算
- 设计模式原则
- update 三种更新用法
- 矩的性质
- NGINX安装与简单的压力测试
- Windows Phone学习第一天[执行模型]
- 开始
- ASP.Net 获取文件的路径
- 学习设计模式资料
- Android 无线调试
- 多线程多进程优先级理解--优先级反转