Created
June 15, 2016 10:22
-
-
Save nprussell/56ccb44e7a2a593f609b36b265fc05e5 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 users.display_name, serialNumbers.location, COUNT(serialNumbers.Location) AS cnt | |
FROM tracking | |
INNER JOIN users ON tracking.user=users.id | |
LEFT JOIN serialNumbers ON serialNumbers.serial=tracking.computerSerial | |
GROUP BY serialNumbers.location | |
HAVING ( cnt > 0 ) | |
ORDER BY cnt DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment