-
-
Save Drarok/8259d275f39c22eedb68 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) / 1073741824) 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.VcenterId | |
ORDER BY | |
DifferenceGB DESC | |
LIMIT | |
5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment