Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select o.customer_email, if(sab.firstname is null, "", sab.firstname) as first_name
- from fahasa_suborder so
- join fahasa_suborder_item soi on so.order_id = soi.order_id and so.suborder_id = soi.suborder_id
- join fhs_sales_flat_order o on o.increment_id = so.order_id
- join fhs_catalog_product_entity pe on pe.entity_id = soi.product_id
- JOIN fhs_sales_flat_order_address sab ON o.billing_address_id = sab.entity_id
- where pe.sku = '9786047756230'
- and so.parent_id is null
- and so.status not in ('complete', 'canceled', 'delivering', 'packed', 'delivery_failed','ebiz_returned', 'delivery_returned')
- group by o.customer_email
- order by o.created_at;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement