954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

get year now and 10 year before

hy....
how to get year now and 10 year before with query
result is 2009,2008,2007,2006,......

thanx..

am_dumb
Newbie Poster
9 posts since Jul 2006
Reputation Points: 12
Solved Threads: 0
 

you simply need to use TO_CHAR for the purpose and convert the sysdate to desired format.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

is there any other option to get the solution?

violette
Junior Poster in Training
63 posts since Jun 2011
Reputation Points: 10
Solved Threads: 0
 
select to_char( add_months(sysdate, (-12*level)) , 'yyyy') years 
from dual
connect by level <= 10
baki100
Junior Poster in Training
79 posts since Apr 2009
Reputation Points: 12
Solved Threads: 14
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You