ITPub博客

首页 > 数据库 > Oracle > 對 Oracle 9i 新數據類型的學習

對 Oracle 9i 新數據類型的學習

原创 Oracle 作者:ysjxjf 时间:2005-09-02 15:03:53 0 删除 编辑

Timestamp , interval year to month , interval day to second:

create table test_data_type(start_time timestamp(6) , duration_1 interval day(6) to second(6) , duration_2 interval year(2) to month );

insert into test_data_type(start_time) select to_timestamp(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss' ) ,'yyyy-mm-dd hh24:mi:ss.ff') from dual;

select start_time , sysdate , start_time - sysdate from test_data_type;

insert into test_data_type(duration_1)
select interval '5 2' day to hour - interval '1:30' hour to minute from dual;

insert into test_data_type(duration_1)
select interval '5' hour - interval '1:20' hour to minute - interval '30:30' minute to second from dual;

insert into test_data_type(duration_1)
select interval '5' day - interval '1 0:12' day to minute from dual;

insert into test_data_type(duration_2)
select interval '5' year - interval '1-1' year to month from dual;

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/66634/viewspace-805690/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-04-24

  • 博文量
    381
  • 访问量
    3205375