Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8894493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:30:41+00:00 2026-06-14T23:30:41+00:00

In my database there is table as below +—-+———–+———-+ | id | fk_id |

  • 0

In my database there is table as below

+----+-----------+----------+
| id | fk_id     | duration |
+----+-----------+----------+
|  1 |        23 | 00:00:31 |
|  2 |        23 | 00:00:36 |
|  3 |       677 | 00:00:36 |
|  4 |       678 | 00:00:36 |
+----+-----------+----------+

In the above table the column duration is of data type time .

The following one is the schema of that table

Create Table: CREATE TABLE `durationof` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fk_id` int(11) NOT NULL,
  `duration` time NOT NULL,
  PRIMARY KEY (`id`))

Here the thing just I want to add all times in a duration column in a query, how can I?

Just like sum function is there any function to add all mysql time vales .

I tried select addtime(diration) from durationof;

But that is not working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:30:43+00:00Added an answer on June 14, 2026 at 11:30 pm

    I completely disagree with @Corbin’s original answer. As documented under The TIME Type:

    TIME values may range from '-838:59:59' to '838:59:59'. The hours part may be so large because the TIME type can be used not only to represent a time of day (which must be less than 24 hours), but also elapsed time or a time interval between two events (which may be much greater than 24 hours, or even negative).

    To take the summation of all such intervals: convert to seconds, take the sum and then convert back again.

    SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(duration))) FROM durationof
    

    See it on sqlfiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a MySQL (5.1) database table there is data that represents: how long a
There is a table reservations in mysql database in the below format. id |
Assume that in a database table there is a non-key column called RECORD_ID which
I have a column in a SQL Server database table, there is a column
There is a table in a SQL database like below : SampleTable : -----------------------
In our database there is a table which is created with ANSI_NULLS OFF .
There is a table employee in the database abc_db at abc@localhost(server) and there is
I have a database in which there is a user table & how many
I'm looking through my organization's database, and there is a table called dbo.Account_Alerts, and
I'm creating a grails app over a legacy database. There is a table out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.