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
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, |
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
# Simple version | |
SELECT | |
username, | |
max(connected), | |
max(disconnected) | |
FROM radacct | |
GROUP BY username | |