Database Administration (MOSC)

MOSC Banner

Conversion to year month

edited Feb 22, 2012 8:08AM in Database Administration (MOSC) 5 commentsAnswered
I've to convert the value of HIGH_VALUE column to add months to the value.

SQL> select high_value from part_info where high_value !='MAXVALUE';

HIGH_VALUE
------------------------------
'2005-10'
'2005-11'
'2005-12'
'2006-01'
'2006-02'
'2006-03'
'2006-04'
'2006-05'
'2006-06'
'2006-07'
'2006-08'
'2006-09'
'2006-10'
'2006-11'
'2006-12'
'2007-01'
'2007-02'
'2007-03'
'2007-04'
'2007-05'
'2007-06'
'2007-07'
'2007-08'
'2007-09'
'2007-10'

25 rows selected.

SQL> select to_yminterval('2007-10') from dual;

TO_YMINTERVAL('2007-10')
---------------------------------------------------------------------------
+000002007-10

SQL> select to_yminterval('2007-09') from dual;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center