Created
August 21, 2015 15:08
-
-
Save ssaid/fc76b99b1352c05de69d to your computer and use it in GitHub Desktop.
Query to export to CSV
This file contains hidden or 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
``` | |
COPY(SELECT rp.name AS Partner, rpa.name as Contact_Name, rpa.street, rpa.street2, rpa.city, rpa.zip, rcs.name as state, rc.name as country FROM res_partner_address rpa | |
JOIN res_partner rp ON rpa.partner_id=rp.id | |
JOIN res_country rc ON rpa.country_id=rc.id | |
JOIN res_country_state rcs ON rpa.state_id=rcs.id | |
WHERE rpa.type IS NULL AND rpa.active IS True | |
ORDER BY rp.name) | |
TO '/tmp/res_partner_address_type_null.csv' DELIMITER ',' CSV HEADER; | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment