On 13-Aug-2001 hassan el forkani wrote:
> hello;
> can someone please help me with this query:
> 
> "delete from TABLE_NAME where TIMESTAMP_COLUMN(date, interval 3 day) <
> now()"
> 
> what i'm tryng to do is to delete all records that are 3 (or more) days old
> i've looked around in the manual but couldn't find a "working answer", date 
> functions are only explained for select queries...
> 
> 
> mysql version :3.23.33
> server error : syntax error near'(date, interval 3 day)...
> 

DELETE FROM da_table WHERE da_date < DATE_SUB(current_date, INTERVAL 3 DAY);

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to