Skip to content

Instantly share code, notes, and snippets.

@vjyanand
Last active November 1, 2022 03:04
Show Gist options
  • Save vjyanand/332de494207535e94719b837d5514a27 to your computer and use it in GitHub Desktop.
Save vjyanand/332de494207535e94719b837d5514a27 to your computer and use it in GitHub Desktop.
APNS_DUPLICATE
delete FROM apns_master WHERE id IN (SELECT id FROM (SELECT id, token, updated, ROW_NUMBER() OVER w AS rnum FROM apns_master WINDOW w AS (PARTITION BY token ORDER BY updated DESC)) t WHERE t.rnum > 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment