diff bw data of d same column
4 posters
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
diff bw data of d same column
que,,, For each employee, calculate the number of months between today and the date the employee was hired
hansi- Posts : 6
Points : 8
Join date : 2010-03-03
Age : 37
Location : u.p.
Re: diff bw data of d same column
You can use months_between () function to calculate the number of months..
say for example
MONTHS_BETWEEN('01-SEP-95' '11-JAN-94') WILL GIVE YOU THE REQ RESULT
say for example
MONTHS_BETWEEN('01-SEP-95' '11-JAN-94') WILL GIVE YOU THE REQ RESULT
Vineet_More- Posts : 27
Points : 31
Join date : 2010-02-26
Re: diff bw data of d same column
Vineet_More wrote:You can use months_between () function to calculate the number of months..
say for example
MONTHS_BETWEEN('01-SEP-95' '11-JAN-94') WILL GIVE YOU THE REQ RESULT
oh yeah thnx,,,,,,
hansi- Posts : 6
Points : 8
Join date : 2010-03-03
Age : 37
Location : u.p.
Re: diff bw data of d same column
can someone tel me how to use the above command!!!
SQL> select months_between('01-SEP-95' '11-JAN-94');
ERROR at line 1:
ORA-00909: invalid number of arguments
SQL> select months_between('01-SEP-95' '11-JAN-94');
ERROR at line 1:
ORA-00909: invalid number of arguments
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: diff bw data of d same column
u frgt 2 use comma and specify table name,,,,
select months_between('01-SEP-95','11-JAN-94')
from tablename;
select months_between('01-SEP-95','11-JAN-94')
from tablename;
hansi- Posts : 6
Points : 8
Join date : 2010-03-03
Age : 37
Location : u.p.
Re: diff bw data of d same column
@hansi
can you post your table and the output for the above!!!
can you post your table and the output for the above!!!
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: diff bw data of d same column
ya sure
select months_between('01-SEP-95','11-JAN-94')
from emp_338049;
MONTHS_BETWEEN('01-SEP-95','11-JAN-94')
---------------------------------------
19.6774194
19.6774194
19.6774194
19.6774194
19.6774194
19.6774194
see u hav nthng 2 do wid tablename just specify it,,,,,,,,,
select months_between('01-SEP-95','11-JAN-94')
from emp_338049;
MONTHS_BETWEEN('01-SEP-95','11-JAN-94')
---------------------------------------
19.6774194
19.6774194
19.6774194
19.6774194
19.6774194
19.6774194
see u hav nthng 2 do wid tablename just specify it,,,,,,,,,
hansi- Posts : 6
Points : 8
Join date : 2010-03-03
Age : 37
Location : u.p.
Re: diff bw data of d same column
hansi wrote:u frgt 2 use comma and specify table name,,,,
select months_between('01-SEP-95','11-JAN-94')
from tablename;
u can use "dual" table in place of table name
urvershi- Posts : 21
Points : 70
Join date : 2010-02-26
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|