PL SQL:如何显示时间戳的纳秒 [英] PL SQL :How to show nanoseconds of a TIMESTAMP

查看:123
本文介绍了PL SQL:如何显示时间戳的纳秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个时间戳,即start = 15-03-11 15:10:10和finish = 15-03-11 15:10:10并且我需要减去它们("finish-start")才能找到持续时间.因为它们的差异在纳秒级,所以我需要将它们分别转换为15:10:10.000000001和15:10:10.000000015.

I have two timestamps i.e. start= 15-03-11 15:10:10 and finish=15-03-11 15:10:10 and i need to subtract them ("finish-start" ) in order to find the duration. Because their difference is in nanosecond level, i need to convert them into 15:10:10.000000001 and 15:10:10.000000015 respectively.

推荐答案

取决于它们的存储方式-TIMESTAMP列的默认设置仅保留小数点后6位. com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i53219"rel =" nofollow> Oracle参考,因此必须将字段声明为TIMESTAMP(9),如果是这样,则两者之间的区别将是还需要声明为 INTERVAL(9)

Depends on how they have been stored - the default setting for TIMESTAMP columns only holds to 6 decimal places Oracle reference so the fields have to be declared TIMESTAMP(9) and if so then the difference will also need to be declared as INTERVAL(9)

这篇关于PL SQL:如何显示时间戳的纳秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆