Home » SQL & PL/SQL » SQL & PL/SQL » Get past history data of 5 years from present data
Get past history data of 5 years from present data [message #328269] Thu, 19 June 2008 10:16 Go to next message
arunsuresh100
Messages: 38
Registered: December 2006
Member
Hey guys,
Can you please let me know how to get the data from the current sysdate to the past 5 years data.
e.g: Sysdate-(5 years past data)
Urgent
Thanks in advance

Arun
Re: Get past history data of 5 years from present data [message #328272 is a reply to message #328269] Thu, 19 June 2008 10:19 Go to previous messageGo to next message
BlackSwan
Messages: 25032
Registered: January 2009
Location: SoCal
Senior Member
arunsuresh100,
We don't respond to "urgent" requests.

http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above

Too bad for you that both the Search function on this forum & GOOGLE are broken for you.

Please standby while repairs are completed.

Re: Get past history data of 5 years from present data [message #328274 is a reply to message #328272] Thu, 19 June 2008 10:21 Go to previous messageGo to next message
arunsuresh100
Messages: 38
Registered: December 2006
Member
hey boss sorry for the message urgent...please help me..dude
Re: Get past history data of 5 years from present data [message #328276 is a reply to message #328269] Thu, 19 June 2008 10:23 Go to previous messageGo to next message
BlackSwan
Messages: 25032
Registered: January 2009
Location: SoCal
Senior Member
With regards to your requested response, you can have it Good, fast, or cheap. Which two do you select?
Re: Get past history data of 5 years from present data [message #328277 is a reply to message #328276] Thu, 19 June 2008 10:28 Go to previous messageGo to next message
arunsuresh100
Messages: 38
Registered: December 2006
Member
Cheap in fast way but in Good manner
Re: Get past history data of 5 years from present data [message #328279 is a reply to message #328277] Thu, 19 June 2008 10:34 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Look in the oracle documentation for the add_months function. (I chose cheap and fast for you as you were unable to choose only 2 for yourself)
Re: Get past history data of 5 years from present data [message #328720 is a reply to message #328276] Sun, 22 June 2008 04:38 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Hi anacedent,

Just out of curiosity, would DBMS_FLASHBACK package help?

Re: Get past history data of 5 years from present data [message #328722 is a reply to message #328720] Sun, 22 June 2008 05:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64098
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No.

Regards
Michel
Re: Get past history data of 5 years from present data [message #328731 is a reply to message #328269] Sun, 22 June 2008 08:49 Go to previous messageGo to next message
BlackSwan
Messages: 25032
Registered: January 2009
Location: SoCal
Senior Member
>Just out of curiosity, would DBMS_FLASHBACK package help?
post coded example where it does help.
Re: Get past history data of 5 years from present data [message #328888 is a reply to message #328731] Mon, 23 June 2008 04:31 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
It's just possible that the answer to this one is
SELECT <columns> 
FROM <table>
WHERE <date_column> BETWEEN add_months(sysdate,-(5*12)) AND sysdate;


If you're actually looking for a way to retrieve what the record looked like 5 years ago, you're probably out of luck.

If you've got some auditing system in place, that might have the data.

If you've got a 5 year old backup and all the archive log files, you could restore to that point in time, and slowly move forwards.

Otherwise, I think you're out of luck.
Previous Topic: MERGE...USING 'nothing' INSERT...UPDATE
Next Topic: Update SQL scripts
Goto Forum:
  


Current Time: Fri Dec 02 12:44:49 CST 2016

Total time taken to generate the page: 0.16487 seconds