Last active
February 3, 2023 15:22
-
-
Save vilusa/ddafcba616368798e1f028713e74cf93 to your computer and use it in GitHub Desktop.
customer sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM customers WHERE id IN( | |
SELECT id FROM ( | |
SELECT c.id FROM customers c | |
LEFT JOIN feedbacks f ON c.id = f.creator_id | |
WHERE | |
c.node_id = 'b2bfa5ea-579a-46fe-9e45-1ebc8df44082' | |
AND f.creator_id IS NULL | |
AND c.email IS NULL | |
AND c.phone_number IS NULL | |
AND c.external_id IS NULL | |
AND c.deleted_at IS NULL | |
LIMIT 10000 | |
) t | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment