Mysql Time Count

Asked

Viewed 322 times

0

I have a table where you count the time of client connections on freeradios, every time the customer enters or leaves the network he logs. I would like your help to know how long each user has navigated each day differently in Mysql.

EX:

fulanoA: 1000
FulanoB: 1728
FulanoC: 12

The table is as follows

CREATE TABLE `radacct`
  `username` varchar(64) NOT NULL DEFAULT '',
  `acctsessiontime` int(12) UNSIGNED DEFAULT NULL,
)
  • Define "sailed by day differently".

  • 1

    Friend, your table does not register the necessary, do you only have the user input time? And when did it leave? Do you not log? How do you plan to calculate their connection time without this information?

  • In acctsessiontime it is seconds that it remained connected

1 answer

2

Select username, Sum(acctsessiontime) as tempo_logado from radacct Group By username

so you will have a listing per user, how many seconds it stayed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.