本文介绍了oracle的时差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时差



A1 = 17/07/2014 12:47:46 PM -date

A2 = 12:10 -Varchar

A3 = 17/07/2014 10:53:34 AM -date



1)a1-a2(小时,分钟) )= 0小时37分钟

2)a1-a3(小时,分钟)= 1小时54分钟



谢谢



我尝试了什么:



(TO_DATE(to_CHAR(a1,'hh24:mi'),'HH24 :MI') - TO_DATE(to_CHAR(a2,'hh24:mi'),'HH24:MI'))* 24作为OBhour,

(TO_DATE(to_CHAR(a1,'hh24:mi') ),'HH24:MI') - TO_DATE(to_CHAR(a2,'hh24:mi'),'HH24:MI'))* 24 * 60 as OBmin



----输出----

for

1)0小时37分钟

2)1.54小时114分钟

Time difference in

A1 =17/07/2014 12:47:46 PM -date
A2 =12:10-Varchar
A3 =17/07/2014 10:53:34 AM -date

1)a1-a2(hours,min) = 0hrs37mins
2)a1-a3(hours,min) = 1hrs54mins

thanks

What I have tried:

(TO_DATE(to_CHAR(a1,'hh24:mi'),'HH24:MI') - TO_DATE(to_CHAR(a2,'hh24:mi'),'HH24:MI'))*24 as OBhour,
(TO_DATE(to_CHAR(a1,'hh24:mi'),'HH24:MI') - TO_DATE(to_CHAR(a2,'hh24:mi'),'HH24:MI'))* 24 * 60 as OBmin

----output ----
for
1)0hrs 37mins
2)1.54hrs 114mins

推荐答案


这篇关于oracle的时差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-20 22:44