通过update语句实现.
sql:update tablename set age=4 where age=2。
解释 :上面表的意思是更新tablename表中age字段值2为4。update语句的作用主要就是通过对某些特定表进行更新,如果没有where条件语句的话,就是更加整张表的age字段值为4。
是所有数据为2的都要改成4还是把其中的一个改成4?
所有的话:update ABC set a=4 where a=2
只改一个的话,要先查出来你要修改的那个a=2的row_number
然后把修改对应的row_number的a的值
update set a =4 from abc where a=2
update abc set a=4 where a=2