oracle中怎么update(更新)date型的数据

 时间:2026-02-12 17:51:42

1、创建测试表,

create table test_date(id number, value date);

oracle中怎么update(更新)date型的数据

2、插入测试数据

insert into test_date values(1,sysdate);

insert into test_date values(2,sysdate-100);

insert into test_date values(3,sysdate-55);

commit;

oracle中怎么update(更新)date型的数据

3、查询表中全量数据,select t.*, rowid from test_date t;

oracle中怎么update(更新)date型的数据

4、编写sql,更新date类型的value字段值为:2010-12-14;

   update test_date set value = to_date('2010-12-14','yyyy-mm-dd') where id = 3;

   commit;

oracle中怎么update(更新)date型的数据

  

5、再次查询sql,可以发现id为3的value值已变化; select t.*, rowid from test_date t;

oracle中怎么update(更新)date型的数据

  • dbeaver怎么连接mysql数据库?
  • notepad++怎么将界面语言设置为中文
  • plsql如何执行.sql文件
  • linux查找文件中的关键字
  • svn怎么切换账号?
  • 热门搜索
    怎么样快速减肥 我的世界怎么打字 头发干枯毛躁怎么护理 华安保险怎么样 墨水怎么洗 怎么缩小鼻头 电脑无法开机怎么办 银杏果怎么吃不中毒 怎么看笔记本型号 电子版手抄报怎么做