Created
December 6, 2016 18:41
-
-
Save gmacdougall/fe10cebd002f007ff3b33a72444909e4 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
| SELECT | |
| spree_orders.id | |
| FROM | |
| spree_orders | |
| WHERE ( | |
| spree_orders.id IN ( | |
| SELECT order_id | |
| FROM spree_orders_promotions | |
| INNER JOIN | |
| spree_promotion_codes | |
| ON spree_promotion_codes.id = spree_orders_promotions.promotion_code_id | |
| WHERE spree_promotion_codes.value LIKE '%first15%' | |
| ) | |
| AND spree_orders.completed_at IS NOT NULL | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment