Created
August 11, 2015 15:34
-
-
Save lfalvarez/b903268a02bada18a6eb to your computer and use it in GitHub Desktop.
SQL util para barriosenaccion
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
COPY(select DISTINCT ON (problem.id) problem.id, body.name, problem.name, users.email, problem.title, problem.state, problem.category, problem.detail, problem.latitude, problem.longitude from problem, users, body where problem.user_id=users.id AND problem.state in ('confirmed', 'investigating', 'in progress', 'planned', 'action scheduled', 'fixed', 'fixed - council', 'fixed - user', 'unable to fix', 'not responsible', 'duplicate', 'closed', 'internal referral') AND problem.whensent > NOW() - INTERVAL '5 weeks' and body.id IN (1, 2, 5)) to stdout | |
COPY(select users.id, users.name, users.email, from_body from users, body ) to STDOUT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment