Last active
December 27, 2015 14:28
-
-
Save workmaster2n/7340362 to your computer and use it in GitHub Desktop.
count 0
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 tracked_point_zones.worker_id, tracked_point_zones.zone_id, COUNT(*) FROM tracked_point_zones | |
| LEFT JOIN zones ON zones.id = tracked_point_zones.zone_id AND tracked_point_zones.recorded_at > '2013-11-01' AND tracked_point_zones.worker_id = 5 | |
| GROUP BY tracked_point_zones.worker_id, tracked_point_zones.zone_id | |
| ORDER BY COUNT(*) DESC |
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 tracked_point_zones.worker_id, tracked_point_zones.zone_id, COUNT(*) FROM tracked_point_zones | |
| RIGHT JOIN zones ON zones.id = tracked_point_zones.zone_id | |
| WHERE | |
| tracked_point_zones.recorded_at > '2013-11-01' AND tracked_point_zones.worker_id = 5 | |
| GROUP BY tracked_point_zones.worker_id, tracked_point_zones.zone_id | |
| ORDER BY tracked_point_zones.worker_id, COUNT(*) DESC |
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 tracked_point_zones.worker_id, tracked_point_zones.zone_id, COUNT(*) FROM tracked_point_zones | |
| JOIN zones ON zones.id = tracked_point_zones.zone_id | |
| WHERE | |
| tracked_point_zones.recorded_at > '2013-11-01' AND tracked_point_zones.worker_id = 5 | |
| GROUP BY tracked_point_zones.worker_id, tracked_point_zones.zone_id | |
| ORDER BY tracked_point_zones.worker_id, COUNT(*) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment