Created
January 12, 2017 22:21
-
-
Save ragingcomputer/a80184d0f5b98c365c59309e4e4d1716 to your computer and use it in GitHub Desktop.
SQL query for Moodle to show space usage in User Private Backup Area by user
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 CONCAT(mu.firstname, ' ', mu.lastname, ' (', mu.email, ')' ) AS Teacher, | |
ROUND((SUM(mf.filesize)/1024)/1024, 2) AS Storage_Used_MB | |
FROM mdl_files AS mf | |
LEFT JOIN mdl_user AS mu ON mf.userid = mu.id | |
WHERE mf.component = 'user' | |
AND mf.filearea = 'backup' | |
AND NOT mf.filename = '.' | |
GROUP BY mf.contextid | |
ORDER BY Storage_Used_MB DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment