Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN;
- DELETE FROM reporter.schedule WHERE run_time<NOW()-INTERVAL '60 days';
- DELETE FROM reporter.report WHERE create_time<NOW()-INTERVAL '60 days' AND recur=FALSE AND id NOT IN
- (SELECT r.id FROM reporter.report r INNER JOIN reporter.schedule s ON r.id=s.report);
- COMMIT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement