minseo

Update更新

格式:

update table _name(表名)

    set col_name(列名) =expr(表达式) 

    where  conti(条件)

 

案例1:

  update 语法可以用新值更新原有表中的各列

 

新建表 插入数据

create table stu(
id number,
name varchar2(64),
sex char(2),
birth date,
money number(10,2),
resu clob
);

 

insert into stu values(
1,\'aaa\',\'m\',\'12-12-13\',2000,\'yeah\');

更新

update stu set sex=\'女\' where id=1;

 

update语句中,set语句指示要修改那些列和赋予那些值

 

让所有学生的money增加10%

update stu set money=money*1.1;

后面不加where及可以修改所有.

 

分类:

技术点:

相关文章:

  • 2021-09-13
  • 2021-11-29
  • 2021-08-04
猜你喜欢
  • 2021-10-20
  • 2021-09-13
  • 2021-08-07
  • 2021-11-03
  • 2021-08-07
  • 2021-08-07
  • 2021-11-14
相关资源
相似解决方案