Bo's Oracle Station

查看: 1016|回复: 0

时间函数

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-9-20 15:46:45 | 显示全部楼层 |阅读模式
  1. create table t071fi11_n ( a long ) ;

  2. insert into t071fi11_n values ('AAA') ;

  3. commit;

  4. update t071fi11_n set a ='                                                                                                                                                                                                 AAA';


  5. select  * from t071fi11_n;

  6. create table t071fi11_o( a  timestamp , b timestamp with  time zone ,  c timest
  7. amp with local time zone ) ;

  8. insert into t071fi11_o values ( current_timestamp , current_timestamp, current_timestamp );

  9. select  * from t071fi11_o;

  10. alter table t071fi11_o add ( d timestamp(9) ) ;

  11. insert into t071fi11_o values ( current_timestamp , current_timestamp, current_timestamp, current_timestamp);

  12. commit;

  13. -----

  14. create table t071fi11_p ( a     interval year to month ,    b   interval year(3)  to month   ,
  15.                                         c  interval day to second    , d   interval   day(3)  to second(3)   );
  16.                                        
  17. insert into t071fi11_p values ( interval '1-2'  year to month ,  interval '100-2'  year(3) to month ,
  18.                                                     interval '10  00:00:30'  day to second,  interval '100  00:00:30.003'  day(3) to second(3) )  ;
  19.                                                    
  20. select  * from t071fi11_p;

  21. select systimestamp+A , systimestamp-B  , systimestamp+C , systimestamp-d from t071fi11_p;

  22. insert into t071fi11_p values ( to_yminterval('1-2') , to_yminterval('100-2') ,
  23.                                                      to_dsinterval('10  00:00:30') , to_dsinterval('100  00:00:30.003')  ) ;


  24. select  * from   t071fi11_p;
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-2 21:01 , Processed in 0.032644 second(s), 24 queries .

快速回复 返回顶部 返回列表