Created
September 11, 2014 20:21
-
-
Save mustmodify/1a910d2385a48cbfe204 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 count(DISTINCT(appointments.id)) from appointments LEFT JOIN pictures ON pictures.appointment_id = appointments.id LEFT JOIN routes ON appointments.route_id = routes.id WHERE pictures.created_at IS NOT NULL AND DATE(CONVERT_TZ(MIN(pictures.created_at), 'UTC', 'US/Eastern')) != routes.date GROUP BY appointments.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment