Created
November 10, 2008 21:48
-
-
Save redsquirrel/23648 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| INSERT | |
| INTO promotion_attempts (audience_member_id, state, mailing_id) | |
| SELECT memberships.audience_member_id, 'ignorant', 18591 | |
| FROM memberships | |
| INNER JOIN audience_members ON memberships.audience_member_id = audience_members.id | |
| WHERE memberships.audience_list_id IN (7310) | |
| AND (audience_members.suppressed IS NULL OR audience_members.suppressed = 0) | |
| AND audience_members.email NOT IN ( | |
| SELECT promotion_attempts.email | |
| FROM promotion_attempts | |
| INNER JOIN mailings ON mailings.id = promotion_attempts.mailing_id | |
| WHERE mailings.promotion_id = 10476 AND promotion_attempts.state != 'ignorant' | |
| AND promotion_attempts.email IS NOT NULL | |
| ) ON DUPLICATE KEY UPDATE state='ignorant' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment