作者:瑞铭与我_109 | 来源:互联网 | 2020-08-26 15:50
sql中修改表的内容有以下三种方法分别是:使用SSMS数据库管理工具修改内容,使用T-SQL脚本修改内容以及多表关联修改表中内容等
修改单表中多行一列或多列数据
语法:update top(数量) 表名 set 列名1=值,列名2=值2 where 条件;
示例:
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=&#39;23&#39; where id>=&#39;5&#39; and id <=&#39;6&#39;;
update top(2) test1 set age=&#39;23&#39; where id>=&#39;5&#39;;
update test1 set age=&#39;23&#39; where test1.id in (select top(2) id from test1 order by id desc);
示例结果:
总结:修改数据表数据,灵活组合修改数据列,数据源,查询条件是关键。
以上就是sql怎么修改表内容的详细内容,更多请关注 第一PHP社区 其它相关文章!