Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delete
- from file_blobs
- where not exists (
- select state
- from process_events
- join cases on process_events.case_id = cases.id
- where
- (
- isnull(cases.resolved_timestamp)
- or
- cases.resolved_timestamp > (
- select create_time from INFORMATION_SCHEMA.TABLES
- where table_schema = 'perform' and table_name = 'process_files_logs'
- )
- ) and state like concat('%', sha1, '%')
- ) and sha1 not in (
- select sha1 from process_files_logs
- ) and sha1 not in (
- select sha1 from slides
- ) and sha1 not in (
- select sha1 from pdfs
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement