Created
November 6, 2015 10:59
-
-
Save chapeupreto/109abbdd7b20c977dd58 to your computer and use it in GitHub Desktop.
SQL query that shows the number of total and allocated IPs for each pool that exists in radippool table
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 | |
pool_name, | |
COUNT(*) AS total, | |
(SELECT | |
COUNT(*) | |
FROM | |
radius.radippool r2 | |
WHERE r1.pool_name = r2.pool_name | |
AND NASIPAddress <> '' | |
GROUP BY pool_name) AS allocated | |
FROM | |
radius.radippool r1 | |
GROUP BY pool_name | |
ORDER BY pool_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment