Created
May 9, 2014 15:40
-
-
Save anonymous/234562aa7013aec995a9 to your computer and use it in GitHub Desktop.
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
SELECT | |
ServerObject.Name, | |
storageYesterday.Committed AS committedYesterday, | |
storageToday.Committed AS committedToday, | |
ROUND((storageToday.Committed - storageYesterday.Committed) / 1024 / 1024 / 1024) AS DifferenceGB | |
FROM | |
ServerObject | |
LEFT OUTER JOIN | |
StorageUsedByVm AS storageYesterday ON | |
storageYesterday.VcenterId = ServerObject.VcenterId | |
AND storageYesterday.Date = CURRENT_DATE() - INTERVAL 1 DAY | |
LEFT OUTER JOIN | |
StorageUsedByVm AS storageToday ON | |
storageToday.VcenterId = ServerObject.VcenterId | |
AND storageToday.Date = CURRENT_DATE() | |
WHERE | |
ServerObject.Disabled = 0 | |
GROUP BY | |
ServerObject.Name | |
ORDER BY DifferenceGB DESC | |
LIMIT 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment