oracle时间戳精度到纳秒,【已解决】如何获取timestamp类型的精度到纳秒级

本帖最后由 阿吉2009 于 2015-7-30 08:57 编辑

SQL> create table t_timestamp

2  (

3    mydate timestamp(9)

4  )

5  ;

表已创建。

SQL> insert into t_timestamp select localtimestamp from dual;

已创建 1 行。

SQL> select to_char(mydate,'yyyy-mm-dd hh24:mi:ss.ff9') time from t_timestamp;

TIME

----------------------------------------------------------

2015-07-30 08:30:56.619671000

SQL> insert into t_timestamp values (to_timestamp('2015-1-1 0:0:0.123456789', 'syyyy-mm-dd hh24:mi:ss.ff9'));

已创建 1 行。

SQL> select to_char(mydate,'yyyy-mm-dd hh24:mi:ss.ff9') time from t_timestamp;

TIME

----------------------------------------------------------

2015-07-30 08:30:56.619671000

2015-01-01 00:00:00.123456789

SQL> select * from t_timestamp;

MYDATE

---------------------------------------------------------------------------

30-7月 -15 08.30.56.619671000 上午

01-1月 -15 12.00.00.123456789 上午

SQL> insert into t_timestamp select systimestamp from dual;

已创建 1 行。

SQL> select * from wangjin_timestamp;

MYDATE

---------------------------------------------------------------------------

30-7月 -15 08.30.56.619671000 上午

01-1月 -15 12.00.00.123456789 上午

30-7月 -15 08.41.53.478498000 上午