UPDATE table SET active = 0 WHERE updated <
DATE_SUB(NOW(),INTERVAL 48 HOUR)

see the manual for more info
http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1322

olinux


--- Scott Haneda <[EMAIL PROTECTED]> wrote:
> I have a timestamp(14) column, I need to
> expire/decay certain records over
> time, can I use NOW() and INTERVAL on a
> timestamp(14) column
> 
> Looking to expire a record that is x hours old
> 
> For example
> Update table set active = '0' where updated = ????
> -- 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to