Have MySQL db with hundreds of thousands of event records. Have nearly solved, this but am missing a conversion. Have addressed data by changing parsing that feeds the database. What was col3 has been split so that col4 is a TYPE = TIME. Which Sums quite nicely and provides a numeric return.
The columns and records look like;
Col1 Char, Col2 DATE, Col3 Char, Col4 TIME
EventType1, YYYY-MM-DD HH:MM:SS, ##d, HH:MM:SS
EventType2, YYYY-MM-DD HH:MM:SS, ##d, HH:MM:SS
EventType1, YYYY-MM-DD HH:MM:SS, ##d, HH:MM:SS
EventType1, YYYY-MM-DD HH:MM:SS, ##d, HH:MM:SS
...
etc.
As an example of a resulting sum of a few records col4 = 4095561. What is the SQL syntax to disp/return this result as HH:MM:SS?
The shell query is:
select cols..., (sum(col4)) as tmax from db where xyz group by Col1 order by col1, etc.
The tmax displays 4095561 -- that's what needs to be formed as HH:MM:SS.
The original is in newbie. Thanks to anyone with insight and offered solutions.
🙂