Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steverobbins/f0e6e2a4fcb024c114d6 to your computer and use it in GitHub Desktop.
Save steverobbins/f0e6e2a4fcb024c114d6 to your computer and use it in GitHub Desktop.
select
sfo.entity_id,
sfo.increment_id,
sfo.created_at,
sfo.status,
sfo.state,
sfo.customer_id,
sfo.ap21_order_id,
sfo.ap21_person_id,
ce.email,
cei.value
from sales_flat_order sfo
left join customer_entity ce
on ce.entity_id = sfo.customer_id
left join customer_entity_int cei
on cei.entity_id = ce.entity_id
and attribute_id = 193
where
sfo.store_id = 7
and sfo.ap21_person_id = 0
order by sfo.created_at desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment