If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > sum field Time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-11, 11:59
trisis trisis is offline
Registered User
 
Join Date: Apr 2011
Posts: 1
sum field Time

Hello all
help me, I'm just learning mysql, I have tabel1 with field Time (10:12:09) how to query enumerates all fields Time in Table1?

example:
record1 00:10:12
record2 00:12:10

Total 00:22:22

thank you

greeting

Trisis
Reply With Quote
  #2 (permalink)  
Old 04-07-11, 12:06
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
use TIME_TO_SEC to convert to integer seconds, apply SUM, then apply SEC_TO_TIME to convert to time format

and next time, please post mysql questions in the mysql forum

ta

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On