Posted on 2015/03/18 18:31
Filed Under 데이터베이스/MYSQL 조회수:

Try using a temp table approach. Try something like this :

Step 1) CREATE TABLE track_table_new LIKE track_table;

Step 2) INSERT INTO track_table_new SELECT * FROM track_table WHERE action=‘DELETE’ AND date_insert >= DATE_SUB(CURDATE, INTERVAL 30 day);

Step 3) ALTER TABLE track_table RENAME track_table_old;

Step 4) ALTER TABLE track_table_new RENAME track_table;

Step 5) DROP TABLE track_table_old;

I did not include the tuple field in Step 2. Please see if this produces the desired effect. If this is what you want, you may want to ditch the tuple field altogether unless you use the tuple field for other reasons.

Writer profile
author image
-아랑 -

트랙백 주소 : 이 글에는 트랙백을 보낼 수 없습니다


by 서진우


· Total
: 4910285
· Today
: 526
· Yesterday
: 744