Last active
July 8, 2016 16:41
-
-
Save jacksoneyton/6dfdf4c0aeb1c3c513edb011fcf4e115 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 `computers`.`name` AS 'PC Name', | |
`computers`.`ComputerID` AS 'Agent ID', | |
`computers`.`OS` AS 'OS', | |
`computers`.`LastContact` AS 'Last Contact', | |
COUNT(hotfixid) AS 'Updates Pending' | |
FROM `hotfix` | |
JOIN `computers`ON ( `hotfix`.`ComputerID` = `computers`.`ComputerID` ) | |
JOIN clients ON (computers.clientid=clients.clientid) | |
WHERE `hotfix`.`Installed`=0 AND `hotfix`.`Approved`=1 | |
AND clients.clientid NOT IN (33) | |
AND `computers`.`LastContact` > DATE_SUB(NOW(), INTERVAL 5 MINUTE) | |
AND computers.os NOT LIKE '%server%' | |
GROUP BY `computers`.`name` DESC | |
ORDER BY COUNT(hotfixid) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment