943,742 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Unsolved
  • Views: 2624
  • Oracle RSS
Jan 16th, 2009
0

get year now and 10 year before

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

thanx..
Similar Threads
Reputation Points: 12
Solved Threads: 0
Newbie Poster
am_dumb is offline Offline
9 posts
since Jul 2006
Jan 16th, 2009
0

Re: get year now and 10 year before

you simply need to use TO_CHAR for the purpose and convert the sysdate to desired format.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Oct 11th, 2011
0
Re: get year now and 10 year before
is there any other option to get the solution?
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
violette is offline Offline
62 posts
since Jun 2011
Dec 20th, 2011
0
Re: get year now and 10 year before
Oracle Syntax (Toggle Plain Text)
  1. SELECT TO_CHAR( ADD_MONTHS(SYSDATE, (-12*LEVEL)) , 'yyyy') years
  2. FROM dual
  3. CONNECT BY LEVEL <= 10
Reputation Points: 12
Solved Threads: 14
Junior Poster in Training
baki100 is offline Offline
79 posts
since Apr 2009
Message:
Previous Thread in Oracle Forum Timeline: reset oracle 10 g password for window 7
Next Thread in Oracle Forum Timeline: Unable to load DLL 'OraOps9.dll'





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC