tenure of emp with days and time [message #207768] |
Wed, 06 December 2006 23:53 |
amit_vass2000
Messages: 52 Registered: December 2006 Location: Delhi
|
Member |
|
|
from my table emp i want to get the information of employees. show ename, number of years,number of months, number of days and number of hours with min and sec. I had made a query by which i was able to fetch no. of years and months, Now plz tell me how i could know no. of days and hours with min and sec. Here it is:-
SQL> select ename,trunc(months_between(sysdate,hiredate)/12) YEARS,
2 trunc(mod(months_between(sysdate,hiredate),12)) MONTHS from emp;
ENAME YEARS MONTHS
---------- --------- ---------
ALLEN 25 9
WARD 25 9
JONES 25 8
MARTIN 25 2
BLAKE 25 7
CLARK 25 5
SCOTT 23 11
KING 25 0
TURNER 25 2
ADAMS 23 10
JAMES 25 0
FORD 25 0
MILLER 24 10
ANGELINA 7 6
sujan 26 6
Amit 28 6
Priyanka 21 1
vikas 20 2
KING
19 rows selected.
|
|
|
|
|
Re: tenure of emp with days and time [message #207817 is a reply to message #207787] |
Thu, 07 December 2006 02:26 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Could you, please, post the output you got when you applied Art Metzer's solution to your problem and explain what part of his solution didn't satisfy your needs (except that you should add hours and minutes)?
Also, it seems that you didn't search good enough. Using "age hours" as keywords brought this topic.
|
|
|