当前第2页 返回上一页
1 2 3 4 5 | update test1 set age='23' where id in ('1','2');
update test1 set age='22' where id between '3' and '4';
update test1 set age='23' where id>='5' and id <='6';
update top(2) test1 set age='23' where id>='5';
update test1 set age='23' where test1.id in (select top(2) id from test1 order by id desc);
|
示例结果:


多表关联修改表中数据
语法:update 表1 set 表1.列1=值,表1.列2=值 from 表1 as a,表2 as b where a.列名=b.列名;
示例:
1 | update test1 set test1.name='李华',test1.sex='女' from test1 as a,test2 as b where a.classid=b.id;
|
示例结果:


总结:修改数据表数据,灵活组合修改数据列,数据源,查询条件是关键。
以上就是sql怎么修改表内容的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
asp.net下oracle,sql server,access万能数据库通用类
更新基本表中的记录使用的sql命令是什么
浅谈mysql中的group by
sql server 编译与重编译详解
数据库性能优化之sql语句优化
一文带你理解慢sql分析与优化
sql中的cte是什么
oracle数据库中sql语句的优化技巧
sql修改语句怎么写
mysql和sql是什么?mysql和sql之间的区别有哪些
更多相关阅读请进入《sql》频道 >>
机械工业出版社
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。
转载请注明出处:木庄网络博客 » sql怎么修改表内容