List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:July 15 1999 1:48am
Subject:Sum of seconds?
View as plain text  
Just trying to clear up my request for help.

I am tying to total the time in seconds from a list of users that have
logged in several times and get a total of their time with the first and
last name.

something like this but with the time being added up for repeat users.
mysql> select sec_to_time(outtime-intime),lastn from monitor;
+-----------------------------+--------+
| sec_to_time(outtime-intime) | lastn  |
+-----------------------------+--------+
| 00:00:33                    | Brantz |
| 00:01:02                    | blow   |
| 00:00:11                    | smith  |
| 00:00:24                    | blow   |
| 00:00:43                    | canel  |
| 01:03:59                    | CHANEY |
| 00:00:32                    | chaney |
| 01:59:45                    | Shaw   |
| 01:45:16                    | Church |
| 01:57:24                    | CHANEY |
| 01:31:25                    | brooks |
+-----------------------------+--------+
11 rows in set (0.00 sec)

So is there a command that I can use to get the sum of
SEC_TO_TIME(outtime-intime), firstn,lastn from monitor group by lastn;
and what would the syntax be for that statement.

Thanks

Douglas

Thread
Sum of seconds?Douglas Brantz15 Jul
  • Re: Sum of seconds?Sasha Pachev15 Jul
  • Re: Sum of seconds?Douglas Brantz15 Jul
    • Re: Sum of seconds?Paul DuBois15 Jul
  • Re: Sum of seconds?Jim Faucette15 Jul