faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 11 people (55%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

I want to delete a record from the database which is not been processed from last 48 hours. URGENT

Feb 22nd, 2008 03:35
dman, Madhulika Chauhan, Narendra Jain, http://sturly.com


Thanx for your answer but sorry i want whole process to be automatic. i 
mean it should delete the record > 48 automatically.
thank
Madhulika
If you have a column in your table - transaction_table called 
process_datetime and a procss_flag to denote if the transaction was 
processed, then use the query of the form:
delete 
from transaction_table
where (to_days(process_datetime) - to_days(today)) > 2
and process_flag = 'N'
;