一. move.sql

use items
set @endTime=(select DATE_SUB(now(),INTERVAL 3 MONTH));

REPLACE INTO new_items (url, title)
SELECT url, title
FROM old_items
    WHERE created < @endTime
    ORDER BY created;

DELETE FROM old_items WHERE created < @endTime

 

#!/bin/sh
cd /opt/projects/my_project
mysql -hlocalhost -uxx -pxxx < move.sql

 

相关文章:

  • 2021-12-28
  • 2021-04-30
  • 2021-06-01
  • 2021-06-14
  • 2022-01-16
  • 2021-08-30
猜你喜欢
  • 2021-07-31
  • 2021-11-03
  • 2021-12-03
  • 2021-11-17
  • 2021-11-27
  • 2021-11-27
  • 2021-11-27
相关资源
相似解决方案