943,742 Members |
Top Members by Rank
Join DaniWeb
Member Log In
Hardware & Software
Software Development
Web Development
Internet Marketing
Business Exchange
Community Center
Web Development
>
Databases
>
Oracle
> get year now and 10 year before
Ad:
Tweet
Oracle
Discussion Thread
Unsolved
Views:
2624
Permalink
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
function to check leap year
in C++
leap year program
in C++
leap year
in C
Loop through a year
in Python
Logic to Convert Days From 1800 to a Date (Month, Day, Year)
in C++
am_dumb
Reputation Points:
12
Solved Threads:
0
Newbie Poster
Offline
9 posts
since Jul 2006
Permalink
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.
debasisdas
Featured Poster
Reputation Points:
665
Solved Threads:
427
Posting Genius
Offline
6,406 posts
since Feb 2007
Permalink
Oct 11th, 2011
0
Re: get year now and 10 year before
is there any other option to get the solution?
violette
Reputation Points:
10
Solved Threads:
0
Junior Poster in Training
Offline
62 posts
since Jun 2011
Permalink
Dec 20th, 2011
0
Re: get year now and 10 year before
Oracle Syntax
(
Toggle Plain Text
)
SELECT
TO_CHAR
(
ADD_MONTHS
(
SYSDATE
,
(
-12
*
LEVEL
)
)
,
'yyyy'
)
years
FROM
dual
CONNECT
BY
LEVEL
<=
10
select to_char( add_months(sysdate, (-12*level)) , 'yyyy') years from dual connect by level <= 10
baki100
Reputation Points:
12
Solved Threads:
14
Junior Poster in Training
Offline
79 posts
since Apr 2009
DaniWeb Message
Cancel Changes
The following errors occurred with your submission
Okay
Tweet
Message:
Posting Quick Reply - Please Wait
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'
User Name
Password
Request Lost username / password
About Us
|
Contact Us
|
Advertise
|
Acceptable Use Policy
Forum Index
|
Build Custom RSS Feed
Follow us on
© 2011 DaniWeb® LLC
What Next? Check out this Product Review:
Review: LightSwitch for Databases and Rapid Application Design