Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
select
-- count(1) ,
o.entity_id
, o.increment_id
, o.created_at
, o.customer_email order_email
, concat(o.customer_firstname, ' ', o.customer_lastname) order_name
, o.store_name
, ab.region billing_region
, ab.fax billing_fax
, ab.postcode billing_postcode
, ab.firstname billing_firstname
, ab.lastname billing_lastname
, ab.street billing_street
, ab.city billing_city
, ab.email billing_email
, ab.telephone billing_telephone
, ab.country_id billing_country_id
, ab.prefix billing_prefix
, ab.middlename billing_middlename
, ab.suffix billing_suffix
, ab.company billing_company
, a_s.region shipping_region
, a_s.fax shipping_fax
, a_s.postcode shipping_postcode
, a_s.firstname shipping_firstname
, a_s.lastname shipping_lastname
, a_s.street shipping_street
, a_s.city shipping_city
, a_s.email shipping_email
, a_s.telephone shipping_telephone
, a_s.country_id shipping_country_id
, a_s.prefix shipping_prefix
, a_s.middlename shipping_middlename
, a_s.suffix shipping_suffix
, a_s.company shipping_company
, p.amount_ordered
, p.method payment_method
, p.cc_type
from ml_sales_flat_order o
inner join ml_sales_flat_order_address ab on ab.parent_id = o.entity_id and ab.address_type = 'billing'
inner join ml_sales_flat_order_address a_s on a_s.parent_id = o.entity_id and a_s.address_type = 'shipping'
inner join ml_sales_flat_order_payment p on p.parent_id = o.entity_id
where
o.created_at > '2017-05-10'
and p.method = 'verisign'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment