Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikepaszkiewicz/13fcfb104ba6f52ec0c6e16b35b1c80a to your computer and use it in GitHub Desktop.
Save mikepaszkiewicz/13fcfb104ba6f52ec0c6e16b35b1c80a to your computer and use it in GitHub Desktop.
get uniq runner ids that don't exist
with x as (select users.id, transactions.runner_id, transactions.runner_obj, transactions.created_at from transactions
left outer join users
on users.id = transactions.runner_id
where transactions.runner_id is not null
and users.id is null)
select distinct runner_id from x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment