There were 2 changes -

First was IF(`status` = 'WIP',SUM(time_to_sec(RIGHT(`CLOCK_TIME`),8)),0)
AS 'WIP'  ( I addded the "RIGHT" limit on the string)

And second was grouping by KEY,STATUS


Further experimentation makes it appear that I am getting the right
number of seconds for the entire string, so I am playing without the
RIGHT() modifier right now. Maybe making a table  with the status's on
separate rows and then querying against that to make the single line??



--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or 
otherwise legally protected. It is intended only for the addressee. If you 
received this e-mail in error or from someone who was not authorized to send it 
to you, do not disseminate, copy or otherwise use this e-mail or its 
attachments.  Please notify the sender immediately by reply e-mail and delete 
the e-mail from your system.


-----Original Message-----

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 19, 2007 12:02 PM
To: mysql@lists.mysql.com
Subject: Re: [MYSQL]time of elapsed time

Weston, Craig (OFT) wrote:
> Baron, thank you for your response. 
> 
> I did get a different result for the query:
> 18184639,12544976,0,0,0,0,0,0,0,0,0,0,0,0
> 
> But it still is "all" the data for the ticket in the row.
> 
> If I group by the ticket (key) number and the status, I get one line
per
> status with the "right" numbers.
> 
> 18184639,240,0,0,0,0,0,0,0,0,0,0,0,0
> 18184639,0,81360,0,0,0,0,0,0,0,0,0,0,0
> 18184639,0,0,10680,0,0,0,0,0,0,0,0,0,0
> 18184639,0,0,0,0,0,0,0,0,38280,0,0,0,0
> 18184639,0,0,0,6480,0,0,0,0,0,0,0,0,0
> 18184639,0,0,0,0,0,0,0,8040,0,0,0,0,0
> 18184639,0,0,0,0,0,0,12081596,0,0,0,0,0,0
> 18184639,0,0,0,0,0,0,0,0,0,139920,0,0,0
> 18184639,0,0,0,0,16080,0,0,0,0,0,0,0,0 
> 
> Can you think of some way to get these numbers on to one row?
> 

What is the query used for that result?

brian

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to