Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SQL query that shows the number of total and allocated IPs for each pool that exists in radippool table
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