Created
June 23, 2015 22:16
-
-
Save shofetim/cd62f6cbb00cef36075f to your computer and use it in GitHub Desktop.
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
SELECT | |
req.is_archived, | |
req.contact_name AS Name, | |
req.address_1 AS "Address 1", | |
req.address_2 AS "Address 2", | |
req.city AS City, | |
states.abbrev AS State, | |
states.name AS "State Name", | |
req.postal_code AS Zip, | |
req.email AS Email, | |
to_char(req.created_at, 'DD Mon YYYY') AS "Request Date" | |
FROM webforms_catalogrequest AS req | |
--INNER JOIN customers_customer AS c ON c.alternative_email_1 = req.email --OR c.alternative_email_2 = req.email | |
INNER JOIN countries_usstate AS states ON states.id=req.state_id | |
WHERE req.created_at > CURRENT_DATE - INTERVAL '90 day' | |
ORDER BY states.abbrev; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment