Created
October 9, 2018 12:53
-
-
Save gwarnants/aea1febb94ce93786880b4ff022d2b0d to your computer and use it in GitHub Desktop.
Export customers information from a PrestaShop database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id_customer, IFNULL(ps_gender_lang.name, NULLIF(ps_customer.id_gender, 0)) AS gender, ps_lang.iso_code AS lang, ps_customer.firstname, ps_customer.lastname, email, ps_customer.company, passwd, secure_key, birthday, newsletter, ip_registration_newsletter, optin, website, ps_customer.note, ps_customer.active, is_guest, ps_customer.deleted, ps_customer. date_add, ps_customer.date_upd, | |
ps_address.alias AS address_alias, ps_address.address1, ps_address.address2, ps_address.company AS address_company, ps_address.postcode, ps_address.city, ps_address.other, ps_address.phone, ps_address.phone_mobile, ps_address.vat_number, IFNULL(ps_country.iso_code,ps_address.id_country) AS country | |
FROM `ps_customer` | |
INNER JOIN ps_lang ON ps_customer.id_lang=ps_lang.id_lang | |
LEFT JOIN ps_gender_lang ON ps_gender_lang.id_gender= ps_customer.id_gender AND ps_gender_lang.id_lang=1 | |
LEFT JOIN ps_address USING(id_customer) | |
LEFT JOIN ps_country ON ps_country.id_country=ps_address.id_country; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment