Beauford wrote:

delete from contacts where TO_DAYS(CURDATE()) - TO_DAYS(today) >= 30 and
status != "Y";

Off-topic: you're defeating indexes with TO_DAYS(). If there's an index on the 'today' column, this will be able to use it:

... where today <= date_sub(current_date, interval 30 day)...

MySQL can't use an index on a column if the column is part of an expression (generally speaking).

Baron

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

Reply via email to