Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- SUM(total)
- FROM
- (SELECT
- DISTINCT (order_id), total_item_count AS total
- FROM
- zzz_sales
- WHERE
- ((created_at BETWEEN '2011-12-01 05:00:00' AND '2012-01-01 04:59:59') AND (STATUS IN ('processing','complete'))) AND (product_type IN ('simple','giftcard'))) AS t;
- SELECT SUM(qty_ordered) FROM `zzz_sales` WHERE ((created_at BETWEEN '2011-12-01 05:00:00' AND '2012-01-01 04:59:59') AND (STATUS IN ('processing', 'complete'))) AND (product_type IN ('simple', 'giftcard'));
Add Comment
Please, Sign In to add comment