Skip to content

Instantly share code, notes, and snippets.

View jammaloo's full-sized avatar

James Freeman jammaloo

View GitHub Profile
CREATE TABLE `radacct` (
`radacctid` bigint(21) NOT NULL AUTO_INCREMENT,
`acctsessionid` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`acctuniqueid` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`username` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`groupname` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`realm` varchar(64) COLLATE utf8_unicode_ci DEFAULT '',
`nasipaddress` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`nasportid` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`nasporttype` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
# Simple version
SELECT
username,
max(connected),
max(disconnected)
FROM radacct
GROUP BY username