botang 发表于 2020-9-20 15:46:45

时间函数

create table t071fi11_n ( a long ) ;

insert into t071fi11_n values ('AAA') ;

commit;

update t071fi11_n set a ='                                                                                                                                                                                                 AAA';


select* from t071fi11_n;

create table t071fi11_o( atimestamp , b timestamp withtime zone ,c timest
amp with local time zone ) ;

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

select* from t071fi11_o;

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

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

commit;

-----

create table t071fi11_p ( a   interval year to month ,    b   interval year(3)to month   ,
                                        cinterval day to second    , d   interval   day(3)to second(3)   );
                                       
insert into t071fi11_p values ( interval '1-2'year to month ,interval '100-2'year(3) to month ,
                                                    interval '1000:00:30'day to second,interval '10000:00:30.003'day(3) to second(3) );
                                                   
select* from t071fi11_p;

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

insert into t071fi11_p values ( to_yminterval('1-2') , to_yminterval('100-2') ,
                                                   to_dsinterval('1000:00:30') , to_dsinterval('10000:00:30.003')) ;


select* from   t071fi11_p;


页: [1]
查看完整版本: 时间函数