List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:July 15 1999 4:51am
Subject:Re: Sum of seconds?
View as plain text  
Douglas Brantz wrote:
> 
> 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
> 

I'm picking this up in the middle, so my suggestion may be out of
context here, but try sum(outtime - intime)
-- 
Sasha Pachev
http://www.sashanet.com
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