Skip to content

Instantly share code, notes, and snippets.

@fmcgeough
Created September 21, 2016 16:58
Show Gist options
  • Select an option

  • Save fmcgeough/c47f20d10a412bbb9d499f033e343403 to your computer and use it in GitHub Desktop.

Select an option

Save fmcgeough/c47f20d10a412bbb9d499f033e343403 to your computer and use it in GitHub Desktop.
SELECT r.recording_id FROM userdata.recordings r
LEFT OUTER JOIN recording_migrator_recordings_existing rmre ON (rmre.recording_id = r.recording_id)
AND r.account_service_id = 1000
AND rmre.recording_id IS NULL;
recording_id
--------------
1000
10000
(2 rows)
SELECT r.recording_id FROM userdata.recordings r
LEFT OUTER JOIN recording_migrator_recordings_existing rmre ON (rmre.recording_id = r.recording_id)
WHERE r.account_service_id = 1000
AND rmre.recording_id IS NULL;
recording_id
--------------
(0 rows)
select * from recording_migrator_recordings_existing;
recording_id | account_service_id | deleted_by_user_id | dt_deleted | permanent_delete
--------------+--------------------+--------------------+----------------------------+------------------
1000 | 1000 | | |
10000 | 1000 | | 2016-09-21 10:13:18.987713 |
(2 rows)
select recording_id, account_service_id from userdata.recordings;
recording_id | account_service_id
--------------+--------------------
1000 | 1000
10000 | 1000
(2 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment