* [EMAIL PROTECTED]
> I'm currently building a database and am using a timestamp(14) column for
> keeping track of when an entry was added to it.

Beware that this column also will be updated when you update _any_ column in
the row...

<URL: http://www.mysql.com/doc/en/DATETIME.html >

> Is there an easy way to
> remove records that are more than 180 days old inside a MySQL query
> instead of going through and removing tham all by hand,

Don't know what you mean by 'removing by hand', I hope you are not editing
the .MYD files directly with a hex editor or similar... ;)

The SQL statement used to remove rows is called DELETE:

<URL: http://www.mysql.com/doc/en/DELETE.html >

To remove rows older than 180 days:

DELETE FROM mytable WHERE timestamp_column < now() - interval 180 day;

HTH,

--
Roger


---------------------------------------------------------------------
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