oracle的时间差问题(20分)

  • 主题发起人 主题发起人 liuguilg
  • 开始时间 开始时间
L

liuguilg

Unregistered / Unconfirmed
GUEST, unregistred user!
我两个时间是
time1=1889-11-01 09:12:22
time2=2006-11-30 13:45:22
我想得到的是 不看日期,只求后面的时间分钟差
这个该怎么做
 
SQL> select empno,to_char(hiredate,'yyyy-mm-dd HH24-MI-SS') from scott.emp where empno in (7369,7499);

EMPNO TO_CHAR(HIREDATE,'YYYY-MM-DDHH
----- ------------------------------
7369 1980-12-17 00-00-00
7499 1981-02-20 00-02-02

SQL>
SQL> select trunc(
2 ((select hiredate from scott.emp where empno=7499)-
3 (select hiredate from scott.emp where empno=7369)-
4 trunc(
5 (select hiredate from scott.emp where empno=7499)-
6 (select hiredate from scott.emp where empno=7369)))*24*60) from dual
7 ;

TRUNC(((SELECTHIREDATEFROMSCOT
------------------------------
2
 
怎么搞得这么复杂?
日期函数???
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
797
DelphiTeacher的专栏
D
D
回复
0
查看
957
DelphiTeacher的专栏
D
后退
顶部