Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.64 KB | None | 0 0
  1. select o.customer_email, if(sab.firstname is null, "", sab.firstname) as first_name
  2. from fahasa_suborder so
  3. join fahasa_suborder_item soi on so.order_id = soi.order_id and so.suborder_id = soi.suborder_id
  4. join fhs_sales_flat_order o on o.increment_id = so.order_id
  5. join fhs_catalog_product_entity pe on pe.entity_id = soi.product_id
  6. JOIN fhs_sales_flat_order_address sab      ON o.billing_address_id = sab.entity_id
  7. where pe.sku = '9786047756230'
  8. and so.parent_id is null
  9. and so.status not in ('complete', 'canceled', 'delivering', 'packed', 'delivery_failed','ebiz_returned', 'delivery_returned')
  10. group by o.customer_email
  11. order by o.created_at;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement