My shipping company requires me to upload an Excel sheet with addresses when I order shipping for a batch of orders.
The format they require is:
Firstname Lastname | Postcode | Address 1 | Mobile phone | Email
I use this MySQL query to get firstname lastname, postcode, address 1 and mobile phone:
SELECT CONCAT(firstname, ' ', lastname) as firstlast, postcode, address1, phone_mobile
FROM `ps_address`
INNER JOIN ps_orders ON ps_orders.id_address_delivery=ps_address.id_address
WHERE current_state = 2
The only problem is that email is missing. I assume I have to include the "email" from ps_customer, but how do I make it into one query?