dbTalk Databases Forums  

To select rows modified within cerain time period

comp.databases comp.databases


Discuss To select rows modified within cerain time period in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default To select rows modified within cerain time period - 07-14-2006 , 09:35 AM






Hi guys,

This might be simplest thing, but I am newbie to databases.

I need to find out only rows modified within certain time period from a
database. As I undertand a way out could be adding an where clause for
the time period might be an option, I might be wrong here again.

But, wanted to know is there any other option. Can triggers or any
other things help me in this matter.

Regards,
Abhijeet


Reply With Quote
  #2  
Old   
Jim Kennedy
 
Posts: n/a

Default Re: To select rows modified within cerain time period - 07-14-2006 , 07:20 PM







<abhi.10dulkar (AT) gmail (DOT) com> wrote

Quote:
Hi guys,

This might be simplest thing, but I am newbie to databases.

I need to find out only rows modified within certain time period from a
database. As I undertand a way out could be adding an where clause for
the time period might be an option, I might be wrong here again.

But, wanted to know is there any other option. Can triggers or any
other things help me in this matter.

Regards,
Abhijeet

select * from mytable where changed_date between start_date_range and
end_date_range.

This is assuming you have a field called changed_date and that it is the
date it changed. If you don't then you can't you would have to add the
field and have a method of updating it when a record is added or updated.
Jim




Reply With Quote
  #3  
Old   
metaperl
 
Posts: n/a

Default Re: To select rows modified within cerain time period - 07-15-2006 , 02:22 AM




abhi.10dulkar (AT) gmail (DOT) com wrote:
Quote:
Hi guys,

This might be simplest thing, but I am newbie to databases.
welcome!

Quote:
I need to find out only rows modified within certain time period from a
database. As I undertand a way out could be adding an where clause for
the time period might be an option,
sure, my first thought is to insure that you have a TIMESTAMP or
DATETIME column. Which database are you using? And can you modify the
table to add such a field?

Quote:
I might be wrong here again.
Just brainstorming, the commit log (which keep track of all changes to
the database) might be another way to do it. But I think the
timestamp/datetime option is cleaner.

Quote:
But, wanted to know is there any other option. Can triggers or any
other things help me in this matter.
The WHERE clause option sounds good. What is the overall application
scenario? Why would you want anything other than a WHERE clause?


Quote:
Regards,
Abhijeet


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.