Reputation: 1189
HI Last night i use this query
DELETE FROM `messages` WHERE last_change < 1332201600 && last_change !=0
but frist problem is after this mysql make my last_change field =0 and the second problem is after 8 hours the table of message get more and get lower for example go to 1,000,000 and then go to 2,000,000 then go 1,500,000 ............ what is the problem?
Upvotes: 0
Views: 44
Reputation: 167182
Instead of giving the timestamp
value in integer, try this query, as there is no operator like &&
and not advisable to use !=
:
DELETE FROM `messages` WHERE `last_change` < TIMESTAMP('1332201600') AND NOT `last_change` 0;
Coz, an example to show about this query is:
SELECT TIMESTAMP('2003-12-31 12:00:00','12:00:00');
-> '2004-01-01 00:00:00'
Upvotes: 1